title: "Intuitive coloring" description: > Using the HSLa color model in CSS. categories: posts
Table of Contents
HSLa is a color model supported by common browsers{:rel="nofollow noopener noreferrer"}. Its acronym stands for hue, saturation, lightness, and alpha. It's meant to be intuitive, and edited by humans. Useful mostly when we are expected to match colors rather than merely applying them. eg.
background-color: hsla(210, 10%, 96%, 1);
From left to right, the params are:
Remembering the color wheel is relatively easy. Front, centered around 0° (and 360°), covers reds. Right, centered around 120°, includes greens. Left, centered around 240° has blues.
Taking the color wheel into account. Hue values go around it clockwise. Hence, values around 0 & 360 covering reds.