From da1d90aa54f68bf9a14ea317c9052a448d0c0da6 Mon Sep 17 00:00:00 2001 From: Adrian Kreher Date: Sat, 20 Dec 2008 01:43:19 -0600 Subject: [PATCH] colortest.pl: fixed a bug. changed the number for colors back to decimal so they are more useful for using in scripts --- colortest.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/colortest.pl b/colortest.pl index d47bfb4..c2cc550 100755 --- a/colortest.pl +++ b/colortest.pl @@ -19,7 +19,7 @@ for my $num (16 .. 231) { # Gray scale for my $num (232 .. 255) { - my $hex = sprintf '%02x', 0x08 + 0x0a * ($num - $GRAY_BASE); + my $hex = sprintf '%02x', 0x08 + 0x0a * ($num - 232); push @arr, join '/', ($hex) x 3; } @@ -27,8 +27,8 @@ print "This is your standard text color.\n"; my $width = 6; for my $num (0 .. $#arr) { print '[38;5;', $num, 'm'; - printf '%02x: ', $num; - print "$arr[$num]  "; + printf '%03d: ', $num; + print "$arr[$num] "; print "\n" if ($num + 1) % $width == 0; } print "\n";