Sign in to follow this  
Esunes

256 colour palette in pascal

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this