-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trouble converting to hex #557
Comments
okay, this works:
I think I needed to map the gamut, then convert to srgb color space before I can format as hex. Am I understanding that correctly? This issue can probably be closed |
Your original example should work with the dev branch, which will soon be v0.6.0. Could you try it and let us know if it doesn’t? |
do I need to pull down the repo and compile to access that, or is there a bundled version available somewhere for quicker access? |
You can just import directly from the colorjs.io website as described here, that always uses the dev branch: https://colorjs.io/get/ |
When's the release? Format is indeed broken in 0.5.2 and using the CDN import works great. |
Hopefully very soon. #537 has the most up to date information on this. |
I would like to point out the hex output can produce a shorthand hex (length of 3 instead of 6) if the notation allows it to be presented that way, which are not allowed on color input types. |
related: #246
I think I'm totally misunderstanding something here. I can't figure out how to convert colors defined in OKLCH to hex. It seems to me this should do it, but it just ignores the requested format (no matter which format I try).
Using the
to()
function instead works for most formats, but not for hex:I've tried a number of other approaches, both with and without a
toGamut()
call, but I think I'm fundamentally misunderstanding something about how or when the library converts between color spaces or something.The text was updated successfully, but these errors were encountered: