How do I get the H value for a Colour Wheel using HSV?

Thanks to StrategicPlayZ’s answer, I have made the colour wheel: https://www.roblox.com/library/6023759238/Colour-Wheel


I want to make a colour wheel. I have the S and V values of HSV but now need the H value.
After doing a bit of research, I found out the H value is the angle from the red area to the cursor position anti-clockwise.

However, I am unable to figure out how to find this angle.

This diagram shows what I am trying to find where the red dot is the cursorand the horizontal line is the red area.
image

Any help is appreciated.
Thanks! :smiley:

local H = (math.pi-math.atan2(MousePosY-CenterPosY,MousePosX-CenterPosX))/(math.pi*2)

I have made a Color Wheel before.

2 Likes