-
Notifications
You must be signed in to change notification settings - Fork 518
Description
I am currently working on a PR that adds a little color preview panel to color sliders, like so:

You might notice in this screenshot that the color in the sliders is a lot "pinker" than the one in the color panel. The color panel, color description, and hex code box are accurate here - if you looked at the way this displayed on a character for instance, it'd be pretty red. If you switched to RGB slider mode, they're also more red.
When the hues are set to perfectly equal increments of 60, it seems accurate. Any deviation from this emphasizes discrepancy. For example:

Perfect blue: slider color value is #0000FF.

Hue 239: slider base color is #0023ff (H: 232). (Not perceptible in this image really, but if you moved the S/V slider buttons out of the way and color picked it, this is the case)
This bug I find is a lot more obvious between hue values of 300 and 360.
(Screenshot taken on Wizard's Den.)
The color that renders on the sliders appears to be #f943bb (H: 320, S: 73, V: 98) based on color picking, and not #f20c7f (H: 330, S: 95, V: 95) like the color picker is using. Here is a side by side comparison:

Steps to reproduce
- Open a UI with a color slider
- Switch to "HSV" color mode
- Set the hue between 300 and 360
- Compare the sliders to other indicators of the current color: the color label, recolorable sprite rendering, or the color in the "RGB" slider mode.
Notes
I am on Debian 12 and this is present both in development and on live servers.
I investigated this bug a little and it kinda stumps me. Here is what I found:
- This ONLY affects the color gradients on the sliders and not anything else.
- The slider values convert to/from actual color data just fine. Like, if you set the HSV color to (330, 100, 100), then the actual color value is (330, 100, 100).
- Sliders are updated with the color value at
UpdateSliderVisuals()
inColorSelectorSliders.xaml.cs
.- This calls
_colorSelectorStyleBox.SetBaseColor(_colorData);
for all color sliders' styleboxes. The color data being passed through here is correct. SetBaseColor
sets the base color of the color slider with this formula:BaseColor = colorData - colorData * XAxis - colorData * YAxis;
. This formula is correct.- The actual visuals of the sliders are updated in
DoDraw()
, which updates the parameter of the shader that the color sliders are using (ColorPicker
). The parameters being set here look correct - at least, they're one-to-one with the ColorSelectorSliders' color value with appropriate channels removed. - It's possible this is an issue with the shader itself and that is beyond my ability to debug
- This calls
- Color rendering is fucked on my computer in certain contexts (usually affecting the whole window rather than one individual element, however) so it's hard to verify if this is a me issue