Open
Description
I was playing around with the library and converter
. When attempted, conversion from oklch
to okhsl
yields weird results. In the documentation I haven't seen any specifics about the the color spaces supported by converter. So I assume it is expected to work.
This is my converter function.
function colorConverter(mode, colorObject) {
let convertFunction = converter(mode);
let convertedColor = convertFunction(colorObject);
return convertedColor;
}
I have added,
useParser("--oklch", "oklch");
The function call is,
let elemColour = colorConverter(colorModes[i], defaultColour);
In that colorModes
is
let colorModes = ["okhsl", "oklch"];
and, defaultColour
is,
let defaultColour = {
mode: "oklch",
l: 0.2,
c: 0.1,
h: 230,
};
this is the results I'm getting,
the values are,
Object { mode: "okhsl", l: 0.09907971332700131, s: -0.14929222272569598, h: 229.99999999999997 }
Object { mode: "oklch", l: 0.2, c: 0.1, h: 230 }
Is there anything I'm missing? Else it looks like there is some bug with converter function
Metadata
Metadata
Assignees
Labels
No labels