lithium\console\Response::styles()
Handles styling output.
Parameters
-
array|boolean
$styles
Returns
arraySource
public function styles($styles = array()) {
$defaults = array(
'end' => "\033[0m",
'black' => "\033[0;30m",
'red' => "\033[0;31m",
'green' => "\033[0;32m",
'yellow' => "\033[0;33m",
'blue' => "\033[0;34m",
'purple' => "\033[0;35m",
'cyan' => "\033[0;36m",
'white' => "\033[0;37m",
'heading' => "\033[1;36m",
'option' => "\033[0;35m",
'command' => "\033[0;35m",
'error' => "\033[0;31m",
'success' => "\033[0;32m",
'bold' => "\033[1m",
);
if ($styles === false) {
return array_combine(array_keys($defaults), array_pad(array(), count($defaults), null));
}
$styles += $defaults;
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
return $this->styles(false);
}
return $styles;
}