Re: [AD] colors addon

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 19-Dec-08, at 8:45 PM, Elias Pschernig wrote:
According to Wikipedia also CSS and .NET recognize these color names, so
some people apparently prefer them over RGB.

(No argument about HSV or HSL <==> RGB converters, they are useful).
Personally, I always do "blue = al_map_rgb(0, 0, 255)" (or makecol()) or something similar and then use "blue" when I want to show something in blue (text, say). The main reason is that "blue" is more readable than "al_map_rgb(...)" when used as a function argument. As such, I don't really see the advantage of "blue = lookup_colour_name("blue")".

Another case where I find standard colours to be useful is to "pick a colour". If I want a shade of gold, say, I either have to fool around with RGB values in my code, or with the colour selection tool in the Gimp, or I look at the list of standard colours on Wikipedia and pick one I like. The latter saves me time.

So, I have once, when I was slightly bored, written a Perl script that parses /usr/X11/lib/X11/rgb.txt (location of this file may vary, seems to be different on my new MacBook) and spits out an Allegro (5) source file with variable definitions and al_map_rgb() assignment statements for each and every colour in there (there are some duplicates). If someone wants to have this, or if we want an addon for this, I can give them either that file or the Perl script and save them some time.

Bottom line: while I find something like this useful, I'm not sure we need to make it an addon. I also don't really care, since I already have this functionality now. ;)

Evert




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/