1. Finding out color code RGB

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.

new topic     » topic index » view message » categorize

2. Re: Finding out color code RGB

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu