The Xwin comes with a predefined set of colors, liseted in the file rgb.txt
rgb uses the default color name database of usr/openwin/lib/X11/rgb.txt to builds a color name database in dbm format.
! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $ 255 250 250 snow 248 248 255 ghost white 248 248 255 GhostWhite 245 245 245 white smoke 245 245 245 WhiteSmoke 220 220 220 gainsboro 255 250 240 floral white 255 250 240 FloralWhite 253 245 230 old lace 123456789-123456789-123456789-123456789-123456789-123456789-123456789-123456789 1 2 3 4 5 6 7
— same version as that of openwin
$ head /usr/openwin/lib/X11/rgb.txt ! $XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp $ 255 250 250 snow 248 248 255 ghost white ...
ls /usr/X11R6/lib/X11/rgb.txt head !$ | cut -f 3 | tail +2
![]() | |
!! |
Found that each multi-word color have a corresponding one-word color version
$ grep '[[:alnum:]] [[:alnum:]]' -A 1 /usr/X11R6/lib/X11/rgb.txt | less 248 248 255 ghost white 248 248 255 GhostWhite 245 245 245 white smoke 245 245 245 WhiteSmoke 220 220 220 gainsboro 255 250 240 floral white 255 250 240 FloralWhite 253 245 230 old lace 253 245 230 OldLace 250 240 230 linen 250 235 215 antique white 250 235 215 AntiqueWhite 255 239 213 papaya whip 255 239 213 PapayaWhip 255 235 205 blanched almond 255 235 205 BlanchedAlmond 255 228 196 bisque 255 218 185 peach puff 255 218 185 PeachPuff 255 222 173 navajo white 255 222 173 NavajoWhite
awk 'NF==4 {print }' < /usr/openwin/lib/X11/rgb.txt
— print all one-word-version-of colors
awk 'NF==4 {print $4}' < /usr/openwin/lib/X11/rgb.txt awk 'NF==4 {printf $4 " "}' < /usr/openwin/lib/X11/rgb.txt
— print all one-word-version-of color names only
ls /usr/X11R6/lib/X11/rgb.txt head !$ | grep -iv grey | awk 'NF==4 {printf $4 " "}' | fold -s -w 72 | ssur '\\' | sed 's/"\\/" \\/g' ^head^cat^ | xsel -c
— grey is just synonym of gray
awk 'NF==4 {printf "'\''#%02x%02x%02x'\'' %s\n", $1, $2, $3, $4 }' < /usr/openwin/lib/X11/rgb.txt
— print all one-word-version-of color and its correspondent hex value