The CSS Podcast cover image

62: Color functions: An update

The CSS Podcast

00:00

Adding Alpha Transparency to an Existing Color Value

The relative color syntax can be used to change the lightness of colors. For example, LCH open up parentheses from space red space Calc L minus 20% space C space H. This creates a new dark red color by setting lightness to 20%. It's not a calculation. It's just a reassignment,. which is what makes this an absolute change to the color and not a relative one. And let's do an RGB example, since we've been working on C H, say you want to do RGB, you would have RGB and then in parentheses fromspace red, that's the color that you're working in. Then you would specify RGB with spaces in between, and

Play episode from 05:26
Transcript

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app