RGB color
RGB (Red, Green, and Blue), like many of the formats we will look at, is a coloring system that’s been around for decades. It works by defining different values for the red, green, and blue components of a color. For example, a red color might be defined in CSS as a hex (hexadecimal) value, #fe0208
:
.redness {
color: #fe0208;
}
The first two digits are the red value in hexadecimal, the next two are the green, and the last two are the blue.
For a great post describing how to understand hex values more intuitively, I can recommend this blog post at Smashing Magazine: https://www.smashingmagazine.com/2012/10/the-code-side-of-color/.
However, with CSS, that same color can equally be described with an RGB functional notation, where each value can be specified in a range from 0
to 255
:
.redness {
color: rgb(254, 2, 8);
}
Hex and RGB values are the kinds of values you will be used to seeing in graphics applications.