Red, green, & blue values (0-255)
RGB (0-255), alpha transparency (0-1)
Also red, green, blue values,
but ranges from 00
–ff
3 / 6 digit: #000
= #000000
Future CSS: alpha transparency
4 / 8 digit:#000a
= #000000aa
Hue (0-360), saturation (0-100%), & lightness (0-100%)
HSL + alpha transparency (0-1)
currentColor
The OG CSS variable
currentColor
= the CSS color
applied to the selected element
inherit
initial
global
Sets text color
Sets currentColor
for element
Sets element’s background color
Sets element’s border color
Sets element’s outline color
Sets element’s box-shadow
Sets element’s text-shadow
Sets element’s column rule color
Sets element’s text-emphasis color
Sets element’s caret color
Set's an SVG element’s fill color
Set's an SVG element’s stroke color
Manipulate color, but don’t actually take color properties
mix-blend-mode
background-blend-mode
An awesome talk of its own…
hsl()
really shines here!
30deg
100%
45%
30deg + 180deg
100%
45%
30deg + 180deg
60%
25%
Move toward the opposite of the wheel the same amount clockwise & counter-clockwise
Move slightly from the original color the same amount clockwise & counter-clockwise
Move around the wheel in 90° increments
Bump the lightness value
Reduce the saturation value
You can easily convert & manipulate colors
$color-primary: #EF6C00;
$color-primary-hover:
scale-color($color-primary, $lightness: -10%);
$color-primary-dim:
change-color($color-primary, $saturation: 15%);
$color-complement:
adjust-hue($color-primary, 180);
Goal: maximum readability for all users
AA & AAA rating
Small & large text
Check color combinations at WebAIM
Scan a live site with WAVE
3:1
contrast ratio between copy & links
Never rely on color alone
Browsers underline links for a reason
There’s no good way to check this contrast automatically.
Choose images with:
currentColor
color
background-color
border-color
outline-color
column-rule-color
box-shadow
text-shadow
fill
stroke
jdsteinbach