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

Enhance precision in HSL to HEX conversion #58

Merged
merged 1 commit into from Nov 26, 2021
Merged

Enhance precision in HSL to HEX conversion #58

merged 1 commit into from Nov 26, 2021

Conversation

cedric-anne
Copy link
Contributor

Conversion from HSL to HEX of a grey color produces unexpected result in some cases, due to a rude int casting.

For instance, converting a hsl(0, 0, 65%) will produces rgb(165.75, 165.75, 165.75). Casting these values to an int will just strip their floating part (i.e 165.75 -> 165), while a round operation would result in a more appropriate result.

@peter279k peter279k merged commit 4043974 into mexitek:master Nov 26, 2021
@peter279k
Copy link
Collaborator

Merged :).

@cedric-anne cedric-anne deleted the fix/grey-hsl branch November 26, 2021 13:23
@cedric-anne
Copy link
Contributor Author

Thanks a lot.

@peter279k
Copy link
Collaborator

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.

None yet

2 participants