[GRASS5] Hex equivalents of grass colors?

Michael Barton michael.barton at asu.edu
Sun Apr 16 00:58:41 EDT 2006


Thanks. This will be helpful. Should I stick a translation procedure into
gm.tcl, or put it elsewhere?

Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton



> From: Cedric Shock <cedricgrass at shockfamily.net>
> Date: Sat, 15 Apr 2006 18:14:09 -0700
> To: <grass5 at grass.itc.it>
> Cc: Michael Barton <michael.barton at asu.edu>
> Subject: Re: [GRASS5] Hex equivalents of grass colors?
> 
> 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