HSV value of a color

Miscellaneous Forums/General Discussion/HSV value of a color

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

Yes, it works.

If you know the palette color with the least maximal deviation from the original color, then you have the best match.

It's simply testing each palette index, and tests the maximal deviation from the original color, if it is less than the previous best match, then this palette index becomes the best match. It's not exactly rocket science :)

If you used the smallest deviation, you would get errors galore. Imagine this:
Palette[0] = 255 255 0
Palette[1] = 254 0 0
Color = 255 0 0
Using the least error would select palette index 0, which is clearly wrong.