Skip to content

HSL Adjustment controls break the colors set by the Default theme preset. #245

@Miniflooglebinder

Description

@Miniflooglebinder

Describe the bug
The HSL Adjustment controls make unexpected changes to the colors set by the Default theme preset. So if you set theme to the Default preset and then adjust the HSL Adjustment controls, any colors set by the Default preset will be overridden to some unexpected colors.

To Reproduce

  1. Set the theme to the Default preset
  2. (Optional) Adjust a few colors, leaving some untouched. (I changed the primary, secondary & card colors)
  3. Navigate to the HSL Adjustments controls and adjust any slider (I adjusted hue shift by -120 deg)
  4. See how the colors we didn't change are incorrect, and the ones we did change are set to the expected colors

Expected behavior
Observe the background color under the Base Colors during this process; the lightness & chroma values change when they shouldn't. Keep in mind that in the screenshots I sent this color was set by the Default theme preset and unchanged by me.

  • Before hue shift: oklch(0.145 0 0) (#0a0a0a)
  • After hue shift: oklch(0.2163 0.0025 145.49) (#191a19)
  • Expected: oklch(0.145 0 0) (#0a0a0a)

Side note; I'm not sure what the expected hue actually is but the chroma and lightness values are not supposed to change if the only slider I changed was the hue shift

Screenshots
Here are the screenshots that show you the before and after of my example

Before:
Image

After:
Image

Desktop:

  • OS: Windows 11
  • Browser Chrome
  • Version 142.0.7444.176

Additional context
I have tried this on a few other theme presets but it seems to only get the wrong colors when they are set by the Default preset.

I also checked if the problem was with the oklch format being the initial color and then shifting the hue caused some incorrect format conversion to hex, but from what I found it seems that's not the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions