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

Add Lab and Lch color spaces #22

Merged
merged 4 commits into from
Nov 9, 2024
Merged

Add Lab and Lch color spaces #22

merged 4 commits into from
Nov 9, 2024

Conversation

raphlinus
Copy link
Contributor

Adds the colorspaces and associated logic.

Also fix map_lightness implementations, I had forgotten that these don't have the same bounds as Oklab and Oklch.

Adds the colorspaces and associated logic.

Also fix `map_lightness` implementations, I had forgotten that these don't
have the same bounds as Oklab and Oklch.
Copy link
Collaborator

@waywardmonkeys waywardmonkeys left a comment

Choose a reason for hiding this comment

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

Some nits, but after that …

color/src/color.rs Show resolved Hide resolved
color/src/colorspace.rs Outdated Show resolved Hide resolved
color/src/colorspace.rs Show resolved Hide resolved
color/src/colorspace.rs Show resolved Hide resolved
color/src/colorspace.rs Outdated Show resolved Hide resolved
Mostly doc fixes.
@@ -202,14 +202,17 @@ impl<CS: ColorSpace> OpaqueColor<CS> {
///
/// In a color space that naturally has a lightness component, map that value.
/// Otherwise, do the mapping in Oklab. The lightness range is normalized so
/// that 1.0 is white.
/// that 1.0 is white. That is the normal range for Oklab but differs from the
/// range in Lab, Lch, and HSL.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sorry, but can these be links?

@@ -298,14 +301,17 @@ impl<CS: ColorSpace> AlphaColor<CS> {
///
/// In a color space that naturally has a lightness component, map that value.
/// Otherwise, do the mapping in Oklab. The lightness range is normalized so
/// that 1.0 is white.
/// that 1.0 is white. That is the normal range for Oklab but differs from the
/// range in Lab, Lch, and HSL.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Links here too?

Since we don't have the HSL color space yet, I linked the relevant spec section. That's a minor cleanup for when we do add HSL.
@raphlinus raphlinus added this pull request to the merge queue Nov 9, 2024
Merged via the queue into main with commit 502dc41 Nov 9, 2024
15 checks passed
@raphlinus raphlinus deleted the lab branch November 9, 2024 16:02
@waywardmonkeys waywardmonkeys added this to the Initial Release milestone Nov 15, 2024
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