#RYB Color Wheel
1 messages · Page 1 of 1 (latest)
<@&987246399047479336> please have a look, thanks.
Here is an AI assisted attempt to answer your question 🤖. Maybe it helps! In any case, a human is on the way 👍. To continue talking to the AI, you can use </chatgpt:1108714622413963314>.
To determine the degree of a color on the RYB color wheel, you can use the following steps:
-
Convert the RGB values to RYB values. The conversion from RGB to RYB is not straightforward, as it involves some complex calculations. However, there are online tools and libraries available that can help you with this conversion.
-
Once you have the RYB values, you can map them to degrees on the color wheel. In the RYB color wheel, red is typically represented at 0 degrees, green at 180 degrees, and orange at 90 degrees.
-
Calculate the angle between your color and each of these reference colors (red, green, and orange) on the color wheel. You can use trigonometry functions such as atan2 or arctan to calculate these angles.
-
Determine which reference color your color is closest to in terms of angle and assign the corresponding degree value.
Note that this method assumes a standard RYB color wheel where red is at 0 degrees, green is at 180 degrees, and orange is at 90 degrees. If you are using a different color wheel with different reference points, you will need to adjust accordingly.
pretty much what the bot said
u just need to convert color model. Wikipedia has the algorithm for u, it's straightforward
https://en.wikipedia.org/wiki/RYB_color_model#:~:text=RYB (an%20abbreviation%20of%20red,pigments%20are%20considered%20primary%20colors.
I cant find there any algo
HSL and HSV are the two most common cylindrical-coordinate representations of points in an RGB color model. The two representations rearrange the geometry of RGB in an attempt to be more intuitive and perceptually relevant than the cartesian (cube) representation. Developed in the 1970s for computer graphics applications, HSL and HSV are used ...
HSV is what u want
the hue value is ur degrees
so u convert RGB to HSV and grab the H value
depending on the algo, its likely 0-255. so u lerp that to 0-360 and that's it
here is a useful link. it's the other way around though:
https://stackoverflow.com/a/46929712
But for some reason it doesnt calulate some right
any ideas what I got wrong there?
public static void main(String[] args) {
float hue = Color.RGBtoHSB(0, 170, 0, new float[3])[0] * 360;
System.out.println("Hue: " + hue);
}
=> 120
120 ist not green, its yellow
0, 170, 0 is not green though
Yeah ik, your calculation probably wrong
can you then say me where the error is?
Even 0 255 0 is H=120
Just checked with a website
Then it might not be what you want
Or there is an offset
Also I think you can’t just compare one specific degree like 180 with a specific color because multiple colors have the same hue
There is a reason why hsb stores three values
how can I calculate the degree then
the H value, as explained earlier, is 0-255
not degree
to get degree, u have to lerp it to 0-360
check his calculation
float hue = Color.RGBtoHSB(0, 170, 0, new float[3])[0] * 360;
I think its 0 - 1.0
so u used HSV, HSL or HSB?
what input color did u try and what was the HSV value u got?
ah. now i see what u want
well, as. the bot originally explained. u have to convert to RYB first
this gives u a vector in this space
after u have the vector, u have to compute the rotation angle it represents on that plane
I dont really understand, sorry 😭