A pragmatic guide to modern CSS colours - part one
Briefly

A pragmatic guide to modern CSS colours - part one
"For most developers, the only time they touch colour values is when they copy them from a design file and paste them into their editor. We are developers and not designers, after all. However, there have been a lot changes to colours in CSS over the last few years - from updates to the syntax of familiar features to all new ways of working with colours - that even copy/pasters can take advantage of."
"In the old days, we had rgb() for a regular rgb colour, and when we wanted to change the opacity of it, we had to use the rgba() function instead. This allowed us to add the fourth value needed to control the alpha channel for the colour. These days, you can add the fourth channel without bothering with the extra character:"
CSS color handling has modernized: rgb() and hsl() now allow an alpha channel without separate rgba() functions, and older comma-separated notation is legacy. Newer color functions require space-separated syntax and unified channel notation. Browser support covers modern browsers; Internet Explorer remains the primary exception. These changes let developers paste or author color values with greater flexibility and fewer characters. Developers can adopt unified alpha channels, avoid legacy commas, and utilize new color features when building color schemes or applying color theory. The newer syntax simplifies opacity control and aligns color functions for consistent usage across CSS.
Read at Piccalilli
Unable to calculate read time
[
|
]