Closed LeaVerou closed 5 months ago
The default space is a string, but we need this to be an instance of the corresponding color space (we generate the sliders based on this.space.cords
):
So, the default value is not parsed but should (already filed the related issue on Nude Element).
I have a fix (I wouldn't say I like it much, though) in case we need something quick (and dirty 😅)
propChangedCallback ({name, prop, detail: change}) {
if (name === "space") {
if (typeof this.space === "string") {
this.space = prop.parse(this.space);
}
...
}
It seems to me I could find (or become a bit closer to) a better (more general) solution: https://github.com/nudeui/element/pull/9.
This will be fixed automatically as soon as we have a new release of NudeUI Element, so I'm going to close it.
It would be nice to just default to the color space of the color provided. Or even a predefined one, like oklch.
Testcase: https://codepen.io/leaverou/pen/ExzVaPO
Edit: there is actually a static default one,
oklch
. Need to debug why it's not working!