[GRASS5] Hex equivalents of grass colors?
Cedric Shock
cedricgrass at shockfamily.net
Sat Apr 15 21:14:09 EDT 2006
Michael,
> Is there some kind of lookup available for the hex equivalent of standard
> grass colors (red, violet, etc)? Lacking that, is there an RGB lookup that
> I could translate to hex?
This is information is on my wish list too. I found it in:
http://freegis.org/cgi-bin/viewcvs.cgi/grass6/lib/gis/color_str.c
{"white", 255, 255, 255},
{"black", 0, 0, 0},
{"red", 255, 0, 0},
{"green", 0, 255, 0},
{"blue", 0, 0, 255},
{"yellow", 255, 255, 0},
{"magenta", 255, 0, 255},
{"cyan", 0, 255, 255},
{"aqua", 100, 127, 255},
{"grey", 127, 127, 127},
{"gray", 127, 127, 127},
{"orange", 255, 127, 0},
{"brown", 180, 75, 25},
{"violet", 255, 0, 255},
{"indigo", 0, 127, 255}
And of course the red:green:blue format and NONE / none / NonE whatever
returns the special no color.
I've been playing with colors a bit too. I have a little rgb/his color system
color picker that has sliders for red, green, blue, hue, intensity, and
saturation. This is possible since, although neither rgb or his is an
absolute color space, they are remappings of the same color model.
This code snippet takes integer red green and blue values on [0,255] to a hex
color for tcl:
set rX [format %02X $red]
set gX [format %02X $green]
set bX [format %02X $blue]
set color "#$rX$gX$bX"
--Cedric
More information about the grass-dev
mailing list