diff --git a/render_parts.php b/render_parts.php index 80a21c0..24c3f40 100755 --- a/render_parts.php +++ b/render_parts.php @@ -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();