0

Why are UIColor hsb values different from the regular hsl values of a color?

For example the color brown is hue: 0, saturation: 59%, luminosity: 41%, but the UIColor values are hue: 0, saturation: 74%, brightness: 65%

The hue is the same, but the saturation and brightness values differ. I need to use hsb initializer of UIColor for my project. Is there a conversion algorithm?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
mrnifnif
  • 188
  • 10

1 Answers1

2

A few things are going on here.

First, HSB == HSV, as discussed in this post.

Next, the HSB(V) color space and HSL color space are two different beasts. The following image can help visualize it & shows the values you are getting: enter image description here

As to how to convert them:

enter image description here

CodeBender
  • 35,668
  • 12
  • 125
  • 132