[GRASS5] Color prompt partially implemented, color confusion.

Hamish hamish_nospam at yahoo.com
Tue Apr 18 06:27:22 EDT 2006


> There's no reason we can't have two sets of color names, one that is
> to preallocated colors and one that is just many,many,many color
> names that only work as another way of specifying RGB tripples.

If implementing the second case you might as well just have it parse the
700 odd standard X color names from /etc/X11/rgb.txt.

> > If choose to add cyan to the list of standard colours, we may as
> > well renumber them so that the corners use the indices from 1 to 8
> > (i.e. index = 1+r+2g+4b); zero is reserved for transparent in some
> > contexts.
> 
> This doesn't really matter, but that'd be:
> 
> 1 - Black
> 2 - Red 
> 3 - Green
> 4 - Yellow
> 5 - Blue
> 6 - Magenta
> 7 - Cyan
> 8 - White
> 
> I'm kind of partial to
> 1 - Black
> 2 - Red
> 3 - Green
> 4 - Blue
> 5 - Yellow
> 6 - Magenta
> 7 - Cyan
> 8 - White

(any reason?)

I'd prefer to match the ANSI color order (first one).
Does the the old DOS background color order match any of the above?
If there's a standard or some logical order we can latch on to we might
as well use that.

> I'm in favor of some more macros in colors.h somewhere along this vein:
>
> #define BLACK_RGB 0, 0, 0
> #define RED_RGB 255, 0, 0

what's wrong with
 G_str_to_color("red", &r, &g, &b);
and
 R_standard_color(D_translate_color("red"));
?
(or this is for the sub-library layer?)


Hamish




More information about the grass-dev mailing list