Skip to content
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

Allow hsluv to be gamut mapped using the CSS algorithm #431

Merged
merged 1 commit into from
Feb 13, 2024

Conversation

lloydk
Copy link
Collaborator

@lloydk lloydk commented Feb 13, 2024

The hsluv color space wasn't being gamut mapped by the CSS algorithm because it was considered to be an unbounded space and the CSS algorithm exits early if a space is unbounded.

Changing the s and l coordinates to use range instead of refRange makes hsluv a bounded space and allows it to be gamut mapped properly.

Note that testing if a hsluv color was in gamut worked properly because the gamutSpace of hsluv is srgb which is a bounded space.

Convert app with s and l using refRange:

image

s and l changed to use range:

image

The hsluv color space wasn't being gamut mapped by the CSS
algorithm because it was considered to be an unbounded space
and the CSS algorithm exits early if a space is unbounded.

Changing the 's' and 'l' coordinates to use range instead
of refRange makes hsluv a bounded space and allows it to be
gamut mapped properly.

Note that testing if a hsluv color was in gamut worked properly
because the gamutSpace of hsluv is srgb which is a bounded space.
Copy link

netlify bot commented Feb 13, 2024

Deploy Preview for colorjs ready!

Name Link
🔨 Latest commit 6db585d
🔍 Latest deploy log https://app.netlify.com/sites/colorjs/deploys/65cae7a163e9c30008ecf958
😎 Deploy Preview https://deploy-preview-431--colorjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@LeaVerou
Copy link
Member

Thank you!

@lloydk lloydk merged commit 0e1d70c into color-js:main Feb 13, 2024
4 checks passed
@lloydk lloydk deleted the hsluv-gamut branch February 13, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants