You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In my ColorTemperaturePicker implementation, it's just slightly inconvenient to have to convert my kelvin value back to RGB so that iro.Color can use it:
// color comes from component propsnewiro.ColorPicker(el,{color: iro.Color.kelvinToRgb(color),// <--});// Update iro's color every time the color prop changesuseEffect(()=>{constupdatedColor=iro.Color.kelvinToRgb(color);// <--colorPicker.current.color.set(updatedColor);},[color]);
Is there any reason the iro.Color constructor can't accept kelvin format as well?
The text was updated successfully, but these errors were encountered:
Ah, this is a silly oversight on my behalf, sorry about that.
It should be relatively trivial to add support for specifying the initial color as an object like {kelvin: 9000}, I'll take a look at it whenever I have time :)
I've created a color temperature picker React component that wraps iro, and my React component would be used something like this:
In my
ColorTemperaturePicker
implementation, it's just slightly inconvenient to have to convert my kelvin value back to RGB so thatiro.Color
can use it:Is there any reason the
iro.Color
constructor can't accept kelvin format as well?The text was updated successfully, but these errors were encountered: