Color

Learn about the vast variety of colors used to style HTML elements.

Apart from green or black, we sometimes want to use a wider palette of colors. How can we do that?

We can expand the range of colors that we can use to style HTML elements by using RGB, Hex, and HSL values.

Press + to interact
We can access a wide range of colors found on this color wheel using RGB, Hex, and HSL values.
We can access a wide range of colors found on this color wheel using RGB, Hex, and HSL values.

rgb and rgba values

rgb values refer to using red, green, and blue parameters to define a color. You can specify a color by indicating the intensity of each color attribute from a range of 0 to 255. Click the sliders below to see the range of colors you can specify using RGB values:

Specifying range of colors using RBG

As you can see, using rgb values gives access to a much wider selection of color values. Let’s use an RGB ...