judeclarke
judeclarke

Reputation: 1116

Why does the HSV-to-RGB algorithm work the way it does?

I have read the Wikipedia article about converting from HSV to RGB, but I don't understand. Why is each case option the way it is, and why they are ordered like that, if the order matters?

Upvotes: 3

Views: 1129

Answers (1)

Blender
Blender

Reputation: 298156

Wikipedia outlines a pretty bulletproof approach to coding it, so I'll assume you're confused about the implementation's logic. You're confused about this, correct?

enter image description here

If you look at the image adjacent to it, you will see why:

enter image description here

Each channel's function is a piecewise function consisting of five linear segments. The cases account for each range of each distribution, namely the shaded regions of the above picture.

Upvotes: 10

Related Questions