Skip to content
Justice Tech School

Colour Formats

CSS accepts names, hex such as #14b8a6, rgb(), rgba(), hsl() and modern formats. HSL is easy to reason about: hue, saturation, lightness. Alpha adds transparency.

Example
<style>
.a { background: teal } .b { background: #f59e0b } .c { background: rgb(239 68 68 / .6) } .d { background: hsl(200 80% 50%) } div { padding: 6px; margin: 3px 0; color: #0f172a }
</style>
<div class="a">name</div><div class="b">hex</div><div class="c">rgb alpha</div><div class="d">hsl</div>

Exercise

HSL stands for hue, saturation and ___

hue, saturation, 

Quiz Test

Which format is easiest to lighten?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.