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

fix: rgba to hlsa and hexa #47

Conversation

NikarashiHatsu
Copy link
Contributor

This PR fixes #37, where \Color\Rgba incorrectly converts to hlsa and hexa.

Technically, toHexa() and toHlsa() method will save the current alpha channel using into $old_alpha, clone the current color profile, convert to either hlsa or hexa, then re-apply the alpha channel using the $old_alpha.

Also, in PHP 8.1, alphaFloatToHex() will return a deprecation warning because implicit float to integer conversion is deprecated, please check this article to verify.

I also changed the test a little bit to comply the new toHexa value.

@NikarashiHatsu
Copy link
Contributor Author

@ozdemirburak please do not merge this PR before I figure out how to fix the detailed alpha channel issue.

@ozdemirburak
Copy link
Owner

Thanks a lot, @NikarashiHatsu.

@NikarashiHatsu
Copy link
Contributor Author

I might need some help to fix the issue since I'm out of time figuring it out 😓.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

rgba()->toHexa and hlsa()->toHexa not working as expected when alpha opacity
2 participants