2 # Author: Todd Larason <jtl@molehill.org>
3 # $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $
5 print "256 color mode\n\n";
7 # display back ground colors
9 for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) {
11 # first the system ones:
12 print "System colors:\n";
13 for ($color = 0; $color < 8; $color++) {
14 print "\x1b[${fgbg};5;${color}m::";
17 for ($color = 8; $color < 16; $color++) {
18 print "\x1b[${fgbg};5;${color}m::";
23 print "Color cube, 6x6x6:\n";
24 for ($green = 0; $green < 6; $green++) {
25 for ($red = 0; $red < 6; $red++) {
26 for ($blue = 0; $blue < 6; $blue++) {
27 $color = 16 + ($red * 36) + ($green * 6) + $blue;
28 print "\x1b[${fgbg};5;${color}m::";
35 # now the grayscale ramp
36 print "Grayscale ramp:\n";
37 for ($color = 232; $color < 256; $color++) {
38 print "\x1b[${fgbg};5;${color}m::";
44 print "Examples for the 3-byte color mode\n\n";
46 for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) {
50 for ($green = 0; $green < 256; $green+=51) {
51 for ($red = 0; $red < 256; $red+=51) {
52 for ($blue = 0; $blue < 256; $blue+=51) {
53 print "\x1b[${fgbg};2;${red};${green};${blue}m::";
60 # now the grayscale ramp
61 print "Grayscale ramp:\n";
62 for ($gray = 8; $gray < 256; $gray+=10) {
63 print "\x1b[${fgbg};2;${gray};${gray};${gray}m::";