There isn’t anything special about HSV in this regard… you would have the same exact problem with the regular ColorSplitter.
And the problem in that case is not caused by the HSVColorSplitter, since it just returns a float. So any solution would have to deal with floats (in general), not HSVColorSplitter specifically.
Ideally Babylon would consistently use linear space colors everywhere. The only time it needs gamma space is when importing a texture (which will convert from gamma to linear) and when outputting to the fragment shader (which will convert from linear to gamma).
But that’s a separate topic, since that also applies to the regular ColorSplitter, it’s not specific to the HSVColorSplitter. HSVColorSplitter should just behave the same as ColorSplitter.
I agree that the current color space situation in Babylon is very confusing, however HSV is not really a different color space, it’s just a different way of viewing RGB.
From the user’s perspective, they’re just dealing with 3 floats. It doesn’t matter whether those floats are (R, G, B) or (H, S, V), all of the color space issues are exactly the same.
And the user never deals with HSV, they deal exclusively with RGB and floats. There is no separate HSV type, so it’s not adding a new color space.
That’s a great idea, but that’s completely separate to this feature request.
All of the issues you brought up already exist with the regular ColorSplitter, HSVColorSplitter doesn’t make things any worse. All of these questions are solved simply by making HSVColorSplitter behave the same as ColorSplitter.
So it seems very strange to me that you’re essentially saying “we can’t implement HSVColorSplitter until we fix these other unrelated problems which already exist with the regular ColorSplitter”.
I fully support improving the color space management in Babylon, but that can (and should) be done separately from HSVColorSplitter, because it affects everything (including ColorSplitter).
This feature request is extremely small in scope, it’s just asking for something which is identical to ColorSplitter except it outputs (H, S, V) floats instead of (R, G, B) floats.