How RGB and Hex Colors Work
In web design, colors are primarily defined using RGB (Red, Green, Blue) or Hexadecimal codes.
What is RGB?
RGB stands for Red, Green, and Blue. It is an additive color model where red, green, and blue light are added together in various ways to reproduce a broad array of colors. Each channel uses a value from 0 to 255.
Example: rgb(255, 0, 0) is pure Red.
What is Hex?
A Hex code is a hexadecimal way to represent RGB values. It starts with a hash (#) followed by six characters (0-9, A-F). The first two represent Red, the next two Green, and the last two Blue.
Example: #FF0000 is pure Red.