Color Table...

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Color Table...

Post by inflater »

Greetings,
i am searching for a 256-color color table. Like if:

0x00 - black
0x01 - blue
0x02 - green

...etc, I'm searching the colors above 0x0F (15), because i have only 16 color table. Does anybody knows where I can find such a thing?

Thanks for your kind responses.

inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
Mr.Confuzed
Posts: 20
Joined: Fri Nov 24, 2006 10:55 pm
Location: C eh, N eh, D eh

Post by Mr.Confuzed »

The Web Standard colours are available at:
http://www.w3schools.com/html/html_colors.asp

Is that what you were looking for? I would think those would be fairly standard colours. Not to mention, can't you define the 256 colour palette yourself?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Color Table...

Post by Brendan »

Hi,
inflater wrote:i am searching for a 256-color color table.
In 256 colour modes (by default) the first 16 colours are "CGA compatible" (black, blue, green, cyan, red, magenta, brown, light grey, dark grey, light blue, light green, light cyan, light red, light magenta, yellow, white).

IIRC the next 16 colours are a grey scale ranging from black to white. After that I'm not so sure (it's a rainbow, but I don't remember the relationship betweeen value and colours).

The easiest way to find out is to display them on the screen and have a look at them.

A more practical way is to reprogram the colours to something you like, instead of having a strange mixture for backwards compatability. I usually reprogram the pallette so that each value has 3 bits for red, 3 bits for green and 2 bits for blue (e.g. so that 00011100b or 0x1C is green). This makes it easier to calculate the values for pixels (e.g. if you're doing alpha blending or converting from other pixel formats).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Post Reply