What is a hex color?
A hex color is a way to specify colors using hexadecimal (base-16) values, commonly used in web design and digital graphics. It’s represented by a six-digit code, preceded by a #
, with each pair of digits defining the intensity of red, green, and blue components, respectively.
Here's how it works:
#RRGGBB
format, where:- RR is the red component
- GG is the green component
- BB is the blue component
Each pair of hex digits can range from 00
to FF
(0 to 255 in decimal), allowing for 256 variations per color component. For example:
#FF0000
is pure red.#00FF00
is pure green.#0000FF
is pure blue.#FFFFFF
is white.#000000
is black.
In addition, hex colors support an optional transparency or alpha value with eight digits, like #RRGGBBAA
. For example, #FF000080
represents a semi-transparent red.