Ok, so here is an equation for HSV to RGB. Honestly, the easiest to understand was wikipedia, so that is where I go this.
Given a color with hue H ∈ [0°, 360°), saturation SHSV ∈ [0, 1], and value V ∈ [0, 1], we first find chroma:
Then we can find a point (R1, G1, B1) along the bottom three faces of the RGB cube, with the same hue and chroma as our color (using the intermediate value X for the second largest component of this color):
Finally, we can find R, G, and B by adding the same amount to each component, to match value:
No comments:
Post a Comment