Skip to content

[Color 4] Update behavior to match latest specs#278

Merged
nex3 merged 1 commit intofeature.color-4from
update-color
Apr 10, 2024
Merged

[Color 4] Update behavior to match latest specs#278
nex3 merged 1 commit intofeature.color-4from
update-color

Conversation

@nex3
Copy link
Contributor

@nex3 nex3 commented Mar 29, 2024

@nex3 nex3 marked this pull request as ready for review March 29, 2024 22:30
@nex3 nex3 requested a review from Goodwine March 29, 2024 22:31
const hue = normalizeHue(options.hue ?? NaN);
const saturation = options.saturation ?? NaN;
let lightness = options.lightness ?? NaN;
lightness = assertClamped(lightness, 0, 100, 'lightness');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that the JS API says that there will no longer be errors thrown out when the lightness is out of the accepted range. But I'm slightly confused what's supposed to happen in that case. Is the value just passed through and the client/browser will handle such case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's right. Per spec, it will ultimately be gamut-mapped into the display range of the view screen.

@nex3 nex3 merged commit fef63f3 into feature.color-4 Apr 10, 2024
@nex3 nex3 deleted the update-color branch April 10, 2024 00:15
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