in reply to Random xterms in OpenWindows

Since showrgb also prints out the rgb values you can use the brightness equation to determine foreground font (white or black)... something like:
#!/usr/bin/perl use strict; my @colorinfo=<DATA>; my $i = rand @colorinfo; my $line=$colorinfo[$i]; $line=~/(\d+)\s+(\d+)\s+(\d+)\s+(.*)$/; my $brightness=($1*299+$2*587+$3*114)/1000; my $fg=$brightness>135?"black":"white"; exec("xterm -fg $fg -bg \'$4\' -font 6x13 -ls -sb -sl 1000 &"); __DATA__ 199 21 133 medium violet red 176 196 222 light steel blue 102 139 139 paleturquoise4 159 121 238 mediumpurple2 141 182 205 lightskyblue3 0 238 118 springgreen2 255 160 122 light salmon 154 205 50 yellowgreen 178 58 238 darkorchid2 69 139 116 aquamarine4 71 60 139 slateblue4 131 111 255 slateblue1 192 255 62 olivedrab1 139 105 20 goldenrod4 205 155 29 goldenrod3 142 229 238 cadetblue2
... and so forth. (I just concatenated showrgb to the bottom of my script.) 135 was about the value that worked best for my eyes in terms of a cut off between brightness warranting a black foreground color or a white.