Closed jk- closed 5 months ago
@jk- I'm afraid this is related to multi-float-operations rounding issues due to the immediate-mode nature of the control. I think https://github.com/raysan5/raygui/pull/370 should minimize this issue...
This happens, because as the RGB Color approaches black or white there is not enough 'color' information to infer a hue. This issue can be avoided by using the HSV equivalent (GuiColorPickerHSV
), to avoid conversion from RGBA to HSV.
This can be a bit tricky to deal with and basically requires the 'global' color to be stored as HSV and converted to Color
when needed.
The specific sequence of events in GuiColorPicker
(the Color/RGBA variant) is:
GuiColorPanel
as RGBAGuiColorBarHue
(this is where the hue value suffers from low resolution)@jk- I'm afraid this is related to multi-float-operations rounding issues due to the immediate-mode nature of the control. I think #370 should minimize this issue...
I don't think it will change this. I am not sure that this situation can be improved, because it would require buffering of the hue value, which is goes against the immediate-mode, as you already said.
i think docs are fine here. should we update the examples?
should we update the examples?
I just had a look and it seemed so simple that I just did it :P
The controls_test_suite
is the only example that needs updating I think
I'm not sure this is the expected behavior?
The hue bar on the right is moving as you select a color and if you end up on white or black it completely resets
https://github.com/raysan5/raygui/assets/577382/7ed73f84-580f-4eea-9672-aee1919c757e