let’s say that I have a HEX color #a08040. How can I determine in C#, if that color is the one of the many hues of the Brown color ?
In the other words, I have 4 colors: Brown, Red, Black, Gray.
How to determine what color hue is my HEX 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.
If you are using WinForms, the
Color.GetHuemethod will do exactly what you want.Edit
Unfortunately, there is no WPF equivalent to
GetHue, you’ll have to convert to a WinForms Color if you want to useGetHuefrom WPF. You could also compute the Hue yourself, if you’re feeling frisky… Wikipedia has the formula you’d need to use.