1. Finding out color code RGB
- Posted by STQuMan at AOL.COM
Jun 13, 1998
-
Last edited Jun 14, 1998
If I want to find out a color code's RGB (ex. yellow=14={255,255,0}), how
would I go about doing that? I know 1-32 you can do get_all_palette(), but
how do I do that for 256 color modes? (color 255={255,255,255}) How do I find
that out?
Thanks,
Mike Hurley
PS David Cuny--I'm asking this to make a routine to display multiple image
formats with the drawLine() procedure in your WIN32LIB file. EMail me if you
have any suggestions, I'd appreciate it.
2. Re: Finding out color code RGB
- Posted by mountains at MINDSPRING.COM
Jun 13, 1998
-
Last edited Jun 14, 1998
At 08:44 PM 6/13/98 EDT, you wrote:
>If I want to find out a color code's RGB (ex. yellow=14={255,255,0}), how
>would I go about doing that? I know 1-32 you can do get_all_palette(), but
>how do I do that for 256 color modes? (color 255={255,255,255}) How do I find
>that out?
>
In mode 256, get_all_palette returns a sequence with 256
red/green/blue pairs - {{0,0,0},{20,20,20}.....etc}
none of the 3 colors can be more than 63, so white would
be {63,63,63}. Multiply the palette by 4 before using
it with save_bitmap. The normal svga colors are not in
the order you would expect. The program below will show
what's going on.
There's a short program to read/write and display palettes
in mode 256 on my web page: http://www.mindspring.com/~mountains,
it is in the ftp (download) directory, named testpal.ex.
Irv