How I can programmatically split the color circle into sections, and how I can get all RGB color in this sections ?

I want fce which returns me the color section by input parament in RGB color.
int getColorSection(RGB color);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I don’t know if i understood correctly the question, but i think you are asking if a color is more green, more blue or blue red?
This will give you informations on in what section (Red, Green or Blue) it is.
For doing that, without keeping in account human perception of colors, you can do:
Of course this don’t work very well if you have colors with two equal values, if you have red = green, it returns red.
If you have white it returns red, if you have black, it returns blue.
If you need something more fancy, probably as you are asking, then you need to use neirest neighbour approximation and polar coordinates.
You can compute the angle using, as pointed out, the Hue.
From the angle then you can just convert it to an integer.
To compute the hue:
It returns the angle, in degrees, from 0 to 360, of where are you in the color wheel.
You can compute than the section using neirest neighbour.
For example:
Your wheel however seems rotated in respect to the C# color wheel.
You probably need to substract a constant angle that is the exact difference.
If i’m not wrong, the difference is 180°.