hwb() – a color notation for humans?

On the web we can define colors in several Color Spaces. By default we’ve always been using sRGB, but newer ones such as P3 are on the way. To describe a color in CSS (in the sRGB Color Space) we can use the functions rgb() and hsl() today already. Both are well supported, even in their space-separated form.

An additional function to describe colors — one that I quickly skimped over in Michelle’s roundup — is hwb(). Stefan Judis spills the details:

hwb stands for hue (a color angle), whiteness (a percentage) and blackness (a percentage)hwb(10deg 10% 10%). Pick a color and adjust its lightness by adding Black or White.

The entire concept and possible colors can be visualised in a triangle spanned by Black, White and the color of choice.

Stefan provides a handy interactive tool to understand this “easy color notation”, answering questions such as “What happens if you add both black and white?”.

hwb() – a color notation for humans? →

Published by Bramus!

Bramus is a frontend web developer from Belgium, working as a Chrome Developer Relations Engineer at Google. From the moment he discovered view-source at the age of 14 (way back in 1997), he fell in love with the web and has been tinkering with it ever since (more …)

Leave a comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.