Skip to content

Adjust conversion logic to assume no chroma for undefined hues#517

Draft
facelessuser wants to merge 7 commits into
mainfrom
feature/hue-null-chroma-zero
Draft

Adjust conversion logic to assume no chroma for undefined hues#517
facelessuser wants to merge 7 commits into
mainfrom
feature/hue-null-chroma-zero

Conversation

@facelessuser

Copy link
Copy Markdown
Owner

Colors are currently normalized into defined values then passed through a chain of color conversions until the color arrives at the target space. To avoid having to pass undefined values to every space in the chain requiring each space to resolve the undefined values, this approach keeps this logic at the top level of the convert function and applies the chroma hue normalization as the first, initial step before iterating the conversions in the color chain. This keeps the logic generic and requires no modification of every color space.

Resolves #484

@gir-bot gir-bot added S: needs-review Needs to be reviewed and/or approved. C: source Related to source code. labels Jun 15, 2026
@facelessuser

Copy link
Copy Markdown
Owner Author

It has not been decided whether we will do this, but I wanted to capture a potential resolution if we do go down this path.

@facelessuser
facelessuser force-pushed the feature/hue-null-chroma-zero branch from c9b2986 to 26e5c4f Compare June 26, 2026 17:27
Colors are currently normalized into defined values then passed through
a chain of color conversions until the color arrives at the target
space. To avoid having to pass undefined values to every space in the
chain requiring each space to resolve the undefined values, this
approach keeps this logic at the top level of the convert function and
applies the chroma hue normalization as the first, initial step before
iterating the conversions in the color chain. This keeps the logic
generic and requires no modification of every color space.

Resolves #484
@facelessuser
facelessuser force-pushed the feature/hue-null-chroma-zero branch from 26e5c4f to 066027e Compare July 18, 2026 01:33
@gir-bot gir-bot added C: docs Related to documentation. C: hsv HSV colors. labels Jul 18, 2026
@gir-bot gir-bot added C: hsl HSL colors. C: hwb HWB colors. C: tests Related to testing. labels Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: docs Related to documentation. C: hsl HSL colors. C: hsv HSV colors. C: hwb HWB colors. C: source Related to source code. C: tests Related to testing. S: needs-review Needs to be reviewed and/or approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide optional compatibility with CSS LCH->Lab conversion quirk?

2 participants