`MakeHSVFromColor` Verse function does not return expected values

Summary

MakeHSVFromColor produces unexpected HSV values.
Passing those values to MakeColorFromHSV does not return original color.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Verse

Steps to Reproduce

Color := color { R := 0.811765, G := 0.0, B := 1.0 }
HSV := MakeHSVFromColor(Color)

Print("H: {HSV(0)} S: {HSV(1)} V: {HSV(2)}")

Expected Result

H: 288.705902 S: 1.0 V: 1.0

Observed Result

H: 302.027588 S: 4.319373 V: 1.247805

Mismatch aside, as far as I know S and V should not go above 1?

Platform(s)

Windows

Additional Notes

Passing output of MakeHSVFromColor to MakeColorFromHSV does not return original color.

Thank you for the report, we’ll check into it.

Hi: thanks for reporting this. There’s definitely something wonky going on here for this function and we’ll make a fix for this. Keep in mind though that Verse colours are in the ACES 2065-1 colourspace, so the expected values should actually be 216, 0.47, 1.66 (HSV), going from a ACES-2065-1 → linear sRGB → HSV conversion.

1 Like

Thanks! Does this mean that converting a color value to HSV and back is potentially lossy?

As MakeColorFromHSV is documented to have 0.0 <= Value <= 1.0 for S and V, so V of 1.66 might get clamped in this case?

You are correct that It is lossy due to the floating-point math involved for the colourspace transformations. The documentation is wrong in what the expected values could be; it’s assuming only the gamut of sRGB colours that can be interpreted as ACES 2065-1.

1 Like