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

HashLoader can accept rgb colors #586

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Roman178
Copy link

@Roman178 Roman178 commented Apr 9, 2024

What changes are introduced?

HashLoader didn't accept rgb or rgba color (issue #582). I have added a new function that handles rgb color strings.

According to the docs in the mozilla (https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/rgb), I tried to take into account all the cases, namely:
rgb(255 255 255 / 80%)
rgb(255 255 255)
rgb(255, 255, 255, 0.8)
rgb(255, 255, 255)

and their aliases rgba(...

I gave more priority to the opacity value contained in the rgb string. If the string does not contain this value, the opacity value is taken from the argument. I can change it if necessary.

Also I added new test cases for the function calculateRgba

I kindly ask you to review my PR. @davidhu2000

@davidhu2000
Copy link
Owner

@Roman178 thanks for this update, i'll take a look in the next week or two. Crazy busy these days. Appreciate the patience

@Roman178
Copy link
Author

Roman178 commented May 3, 2024

@davidhu2000 Thanks for the heads-up. No rush at all. I appreciate your time.

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