HTML COLORS


HTML Colors can be specified using the pre-defined color names, or using RGB, RGBA or HEX values.

Let's see how we can specify the colors using color names.


Color Name


Let's have a look at few colors:


Orange

OrangeRed

DodgerBlue

HotPink

Yellow

LightCoral

Gold

DarkKhaki

MediumPurple

DarkViolet

SlateBlue

Chartreuse



Color Values (RGB, RGBA, HSL, HEX, HSLA)


RGB, RGBA, HEX, HSL values can also be used to specify colors. Let's see how we can do that:


Color Name

Magenta


Orange

HEX Code

#FF00FF


#FFA500

RGB Code

rgb(255, 0, 255)


rgb(255, 165, 0)



Let's check an example on how we can use these colors:



<p style="color:DeepSkyBlue; background-color:darkblue;">Defining Color using Color Name</p>
<p style="color:#FFE5CC; background-color:#994C00;">Defining Color using Hex Color Code</p>
<p style="color:rgb(153, 0, 153); background-color:rgb(255, 204, 255);">Defining Color using RGB Color Code</p>
<p style="background-color:rgba(255, 215, 0, 0.5);">Defining Color using RGBA Color Code</p>

Live Demo!


Output:

Defining Color using Color Name

Defining Color using Hex Color Code

Defining Color using RGB Color Code

Defining Color using RGBA Color Code



Here's the list of some more colors:


Color Name

HEX Code

RGB Code


IndianRed
#CD5C5C
rgb(205, 92, 92)
LightCoral
#F08080
rgb(240, 128, 128)
Salmon
#FA8072
rgb(250, 128, 114)

Crimson

#DC143C

rgb(220, 20, 60)

Red

#FF0000

rgb(255, 0, 0)

Pink

#FFC0CB

rgb(255, 192, 203)

HotPink

#FF69B4

rgb(255, 105, 180)

PaleVioletRed

#DB7093

rgb(219, 112, 147)

Coral

#FF7F50

rgb(255, 127, 80)

Tomato

#FF6347

rgb(255, 99, 71)

DarkOrange

#FF8C00

rgb(255, 140, 0)

Orange

#FFA500

rgb(255, 165, 0)

Gold

#FFD700

rgb(255, 215, 0)

Yellow

#FFFF00

rgb(255, 255, 0)

Khaki

#F0E68C

rgb(240, 230, 140)

Thistle

#D8BFD8

rgb(216, 191, 216)

Plum

#DDA0DD

rgb(221, 160, 221)

Violet

#EE82EE

rgb(238, 130, 238)

Magenta

#FF00FF

rgb(255, 0, 255)

Purple

#800080

rgb(128, 0, 128)