onlook-dev / onlook

The open source, local-first Figma for React. Design directly in your live React app and publish your changes to code.
https://onlook.dev
Apache License 2.0
3.75k stars 233 forks source link

Fix: Changing colors while hue is all the way left not working #705

Closed iNerdStack closed 3 weeks ago

iNerdStack commented 3 weeks ago

Description

What is the purpose of this pull request?

Added activeHue & localColor state & optimized onChange functions to maintain the selected hue value independently from the color's calculated hue, it allows hue persistence even at low saturation levels which solved the bug issue when selecting colors far left.

  1. Separated hue tracking from color state
  2. Always use ActiveHue when creating new colors
  3. Persist hue value during saturation changes

Related: https://github.com/onlook-dev/onlook/issues/699