Skip to content

[BUGFIX] Don't render rgb colors with % values as hex #803

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

Merged
merged 1 commit into from
Jan 25, 2025

Conversation

JakeQZ
Copy link
Collaborator

@JakeQZ JakeQZ commented Jan 25, 2025

The only percentage values that could be reliably converted to hex notation are 0%, 20%, 40%, etc.
It's beyond the scope of this library to do that.

Also add additional tests to confirm parsing of percentage values. Some of these are commented out, because the input data would result in rendering in an invalid format. (The "legacy" syntax does not allow a mixture of percentages and numbers, so it would be necessary to implement rendering in the "modern" syntax to resolve those cases, which is beyond the scope of this PR.)

@JakeQZ JakeQZ added bug css4 Relating to features introduced in CSS4 labels Jan 25, 2025
@JakeQZ JakeQZ self-assigned this Jan 25, 2025
@coveralls
Copy link

coveralls commented Jan 25, 2025

Coverage Status

coverage: 42.138% (+0.2%) from 41.942%
when pulling 8df0e63 on bugfix/rgb-percentage-render
into 98c8bb8 on main.

The only percentage values that could be reliably converted to hex notation are
0%, 20%, 40%, etc.
It's beyond the scope of this library to do that.

Also add additional tests to confirm parsing of percentage values.
Some of these are commented out,
because the input data would result in rendering in an invalid format.
(The "legacy" syntax does not allow a mixture of `percentage`s and `number`s,
so it would be necessary to implement rendering in the "modern" syntax
to resolve those cases, which is beyond the scope of this PR.)
@JakeQZ JakeQZ force-pushed the bugfix/rgb-percentage-render branch from 4c740e3 to 8df0e63 Compare January 25, 2025 03:54
Copy link
Collaborator

@oliverklee oliverklee left a comment

Choose a reason for hiding this comment

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

LGTM.

@oliverklee oliverklee merged commit 540b315 into main Jan 25, 2025
21 checks passed
@oliverklee oliverklee deleted the bugfix/rgb-percentage-render branch January 25, 2025 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug css4 Relating to features introduced in CSS4
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants