How to generate old syntax for rgba for CSS?
See original GitHub issueI’ve noticed that the library is using this syntax:
rgb(65.098% 49.804% 34.902% / 0.997);
Where can I use browser support for this syntax? It seems this is quite new. Can you generate older syntax:
rgba(100, 100, 100, 0.997);
Where can I check browser support for this new syntax? I work for a library that works in IE11 (I know it’s deprecated but I want my library to work for old browsers even IE11).
Issue Analytics
- State:
- Created a year ago
- Comments:9 (2 by maintainers)
Top Results From Across the Web
rgba() - CSS: Cascading Style Sheets - MDN Web Docs - Mozilla
The rgba() functional notation expresses a color according to its red, green, and blue components. An optional alpha component represents ...
Read more >RGBa Browser Support | CSS-Tricks
RGBa is a way to declare a color in CSS that includes alpha transparency support. It looks like this:
Read more >CSS RGB and RGBA Colors - W3Schools
An RGB color value represents RED, GREEN, and BLUE light sources. RGB Value. In CSS, a color can be specified as an RGB...
Read more >A Guide to CSS RGBA Colors - WebFX
RGBA is a type of CSS color value that allows us to set a color and also its opacity/transparency. Here's an example of...
Read more >How to set color opacity with RGBA in CSS? - GeeksforGeeks
RGBA is a color format, basically containing values for red, green, blue respectively and 'A' in RGBA stands for Alpha. To set the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Not sure why you feel 0-255 is more intuitive, if 0.3333% is hard, why is 84.3333 not hard? Note that the 0-255 are not necessarily integers, exactly because color is not necessarily 8 bit anymore.
I just pushed a fix for that in bf36ebc3e3d077e4e13b3d0f0898f35e594a5891.
Typescript support is still somewhat beta, it was just added in #221. I just pushed a fix for this in d0ab5d1fe61e43f37386f7634a0cc4aee15e2302, @MysteryBlokHed @jgerigmeyer hope I did it right.
I just pushed it in 667c19a60d5a6c8c81e9d07bd217ebda385a10b2 ! Feel free to try it out and let me know what you think! Docs still TBD, would be lovely if someone wanted to help out with that.
Yeah, we should probably remove those docs. They are also wildly out of date.
What is the desired result? It does have commas, and it is
rgba()
so it’s doing everything you asked it to?Percentages are generally better as it’s a representation that is not designed after 8bit implementation constraints. But you can get numbers, it’s just a little more involved:
or, to reuse the format:
We should probably add a shortcut so you can just do
format: "rgba-number"
, I’m just not sure what the use cases are. Why do you need 0-255 numbers?All browsers support percentages in
rgb()
since CSS 1 and inrgba()
sincergba()
existed…