Add OKLAB and OKLCH to color-picker#2446
Conversation
🦋 Changeset detectedLatest commit: ce79247 The changes in this PR will be included in the next version bump. This PR includes changesets to release 85 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@V1OL3TF0X thanks for this PR. Love the direction. Could we do this without an additional dependency? We want to keep the bundle size roughly similar |
@segunadebayo Done - I leaned out the dependency as much as possible. This has the downside of not clamping by chroma but by RGB (less accurate, but I'm not smart enough to translate I also updated the docs a bit, to include the new modes |
Addresses @2439
📝 Description
This PR adds two new modes to the color-picker: oklch and oklab. I also needed to fix a bit of the logic, so switching between modes worked properly. A also tried to update the examples to the best of my abilities
⛳️ Current behavior (updates)
🚀 New behavior
💣 Is this a breaking change (Yes/No):
No
📝 Additional Information
If anything falls outside contribution guidelines, please let me know - I tried to follow the code style to the best of my abilities, but some things may have slipped through.
As parsing oklab and oklch has some complicated math involved, I opted to add culori/js to take care of that