• Advertisement
Sign in to follow this  

256 colour palette in pascal

This topic is 3993 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I need help with 256-colour palette in pascal. I can't find out how convert R,G, and B value of pixel to index of 256-colour palette, which is used in Pascal graphics drivers like VGA,BGI256, MCGA... Palette looks like: http://img405.imageshack.us/img405/1080/paletasx8.png Thanks for advice..

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
The algorithm depends on your palette. In the modes you mention, the palette is setable (it can be any colors you like).

If you can't change your palette, then you need to find the best fit index (use r, g, b as x,y,z coordinates and compute the distance from each palette index and use that index).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement