mirror of
https://gitlab.com/mattia.basaglia/ASCII-Pony.git
synced 2024-11-21 19:57:59 +01:00
Fix output
This commit is contained in:
parent
f907bbd605
commit
d45cdc6cff
1 changed files with 16 additions and 1 deletions
|
@ -201,6 +201,11 @@ class IRCColorOutput extends PlaintextColorOutput
|
|||
}
|
||||
|
||||
function color( Color $color )
|
||||
{
|
||||
return "\x03".$this->color_code($color);
|
||||
}
|
||||
|
||||
function color_code( Color $color )
|
||||
{
|
||||
if ( $color->bright )
|
||||
{
|
||||
|
@ -239,9 +244,14 @@ class AnsiColorOutput extends PlainTextColorOutput
|
|||
}
|
||||
|
||||
function color( Color $color )
|
||||
{
|
||||
return "\x1b[".$this->color_code($color)."m";
|
||||
}
|
||||
|
||||
function color_code( Color $color )
|
||||
{
|
||||
$bold = $color->bright ? "1" : "22";
|
||||
return "\x1b[{$color->color};{$bold}m";
|
||||
return (30+$color->color).";{$bold}";
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -262,6 +272,11 @@ class BashColorOutput extends AnsiColorOutput
|
|||
{
|
||||
return $char == '\\' ? '\\\\' : $char;
|
||||
}
|
||||
|
||||
function color( Color $color )
|
||||
{
|
||||
return "\\x1b[".$this->color_code($color)."m";
|
||||
}
|
||||
}
|
||||
|
||||
$dir = isset($argv[1]) ? $argv[1] : getcwd();
|
||||
|
|
Loading…
Reference in a new issue