Possible Duplicate:
Algorithm to convert RGB to HSV and HSV to RGB?
I'm trying to find an algorithm (prefferabley represented in C++) that converts from RGBto HSB values so that I can process it accordingly. Anyone got any suggestions?
Possible Duplicate:
Algorithm to convert RGB to HSV and HSV to RGB?
I'm trying to find an algorithm (prefferabley represented in C++) that converts from RGBto HSB values so that I can process it accordingly. Anyone got any suggestions?
It's java and not C++ but it should be close enough to be easily reusable. Look for the RGBtoHSB
method in this page:
There's a number of colour algorithms demonstrated here, including the one you require which would be worth reading.