in reply to Re^2: using colors with print()
in thread using colors with print()
I believe there is a need to print the newline character after the reset, not before, or in other words, do not let color attributes span unnecessary lines, and those last lines dealing with $command are redundant.
sub textcolor ($$$); print textcolor (RESET, RED, BLACK), 'In color', textcolor (RESET, WHITE, BLACK), "\n"; sub textcolor ($$$) { my ($attr, $fg, $bg) = @_; sprintf "\e[%d;%d;%dm", $attr, $fg + 30, $bg + 40; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: using colors with print()
by tachyon (Chancellor) on Jun 20, 2004 at 09:30 UTC | |
by pbeckingham (Parson) on Jun 20, 2004 at 15:50 UTC |