-
Notifications
You must be signed in to change notification settings - Fork 276
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
feat: color prop can accept rgb colors #586
feat: color prop can accept rgb colors #586
Conversation
@Roman178 thanks for this update, i'll take a look in the next week or two. Crazy busy these days. Appreciate the patience |
@davidhu2000 Thanks for the heads-up. No rush at all. I appreciate your time. |
Hi @davidhu2000, Thank you for your time and consideration! |
hey @Roman178 the code looks good. I'll get this published as a new version soon |
@davidhu2000 thanks for approving my PR. |
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