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

RGBA color doesn't work correct with border #1491

Open
duyank opened this issue Sep 8, 2021 · 2 comments
Open

RGBA color doesn't work correct with border #1491

duyank opened this issue Sep 8, 2021 · 2 comments
Labels

Comments

@duyank
Copy link

duyank commented Sep 8, 2021

Describe the bug
When I use border color is rgba(60, 217, 48, 0.49);
then it shows like the image below
image

Expected behavior
I wish it can show like text

@diegomura diegomura added the bug label Sep 8, 2021
@tom2strobl
Copy link

I can confirm that rgba values with full opacity (1) work and as soon as transparency is introduced I get a color that makes absolutely no sense, either a full black or a dark blue or whatever, it seems that as soon as alpha is in play some calculation is wildly off.

@David245M
Copy link

David245M commented Mar 26, 2024

Yep, this issue still exists, same rgba value with alpha is less than 1 and looks different for borderColor and backgroundColor.
Reproduction sandbox: https://codesandbox.io/p/devbox/ymm5dc?file=%2Fsrc%2FApp.jsx%3A15%2C31

The temporary solution I have right now is to separate the component into the wrapper and inner components, where the wrapper will have rgb color without alpha value, but the alpha value is set using the opacity property. In the inner component, I reset the opacity back to 1 to avoid applying it anywhere else besides the border color. It's not perfect, but it works for me. You can see an example in the same sandbox above. Open the preview in the separate tab if you have This page has been blocked by Chrome error message in preview.

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

No branches or pull requests

4 participants