#RYB Color Wheel

1 messages · Page 1 of 1 (latest)

tight flint
#

Hello, i've a rgb code - e.g. 255,0,0 (red)

I now need the degree of that in the wheel - see image

So:

  • Red -> 0 (°)
  • Green -> 180 (°)
  • Orange -> 90 (°)
    ... any ideas how to do that?
sweet impBOT
#

<@&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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

white willow
#

pretty much what the bot said

#

u just need to convert color model. Wikipedia has the algorithm for u, it's straightforward

tight flint
#

I cant find there any algo

white willow
#

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

tight flint
#

But for some reason it doesnt calulate some right

tight flint
tight flint
#
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

grizzled steeple
#

0, 170, 0 is not green though

tight flint
#

it is

grizzled steeple
#

Yeah it looks like green

#

But 180 degree is 0 255 0

tight flint
#

But then I somehow need to get 160 or sth

#

Not 120

#

thats yellow

grizzled steeple
#

Yeah ik, your calculation probably wrong

tight flint
#

can you then say me where the error is?

grizzled steeple
#

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

tight flint
#

how can I calculate the degree then

white willow
#

the H value, as explained earlier, is 0-255

#

not degree

#

to get degree, u have to lerp it to 0-360

grizzled steeple
#

check his calculation

#
float hue = Color.RGBtoHSB(0, 170, 0, new float[3])[0] * 360;
#

I think its 0 - 1.0

white willow
#

so h / 255.0 * 360

#

fair

#

it depends on the algo used

grizzled steeple
#

and I checked with a website

#

same result

white willow
#

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

tight flint
#

I dont really understand, sorry 😭

grizzled steeple
#

this might be helpful