Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RGB to HSB Algorithm [duplicate]

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?

like image 813
user965369 Avatar asked Nov 22 '11 13:11

user965369


2 Answers

It's java and not C++ but it should be close enough to be easily reusable. Look for the RGBtoHSB method in this page:

http://www.docjar.com/html/api/java/awt/Color.java.html

like image 199
solendil Avatar answered Sep 28 '22 19:09

solendil


There's a number of colour algorithms demonstrated here, including the one you require which would be worth reading.

like image 35
Michael Berry Avatar answered Sep 28 '22 19:09

Michael Berry