HTML colors

The color may be a represented in one of the three ways.

  • Named colors such as red, green, blue and transparent may be used.

  • The color may be defined by rgb() function (decimal notaion).

  • Hexadecimal notaion may also be used such as #RRGGBB.

Color notations

1. Named colors

CSS defines a lot of named colors. These named colors originally come from HTML. And a version of the most colors is obtained from X11 color system.

'Click' on the respective pallet to copy the color code. Use converter to change the color codes from one notation to another.


converter





aliceblue antiquewhite aqua aquamarine azure beige bisque black blanchedalmond blue blueviolet brown burlywood cadetblue chartreuse chocolate coral cornflowerblue cornsilk crimson cyan darkblue darkcyan darkgoldenrod darkgray darkgreen darkgrey darkkhaki darkmagenta darkolivegreen darkorange darkorchid darkred darksalmon darkseagreen darkslateblue darkslategray darkslategrey darkturquoise darkviolet deeppink deepskyblue dimgray dimgrey dodgerblue firebrick floralwhite forestgreen fuchsia gainsboro ghostwhite gold goldenrod gray green greenyellow grey honeydew hotpink indianred indigo ivory khaki lavender lavenderblush lawngreen lemonchiffon lightblue lightcoral lightcyan lightgoldenrodyellow lightgray lightgreen lightgrey lightpink lightsalmon lightseagreen lightskyblue lightslategray lightslategrey lightsteelblue lightyellow lime limegreen linen magenta maroon mediumaquamarine mediumblue mediumorchid mediumpurple mediumseagreen mediumslateblue mediumspringgreen mediumturquoise mediumvioletred midnightblue mintcream mistyrose moccasin navajowhite navy oldlace olive olivedrab orange orangered orchid palegoldenrod palegreen paleturquoise palevioletred papayawhip peachpuff peru pink plum powderblue purple rebeccapurple red rosybrown royalblue saddlebrown salmon sandybrown seagreen seashell sienna silver skyblue slateblue slategray slategrey snow springgreen steelblue tan teal thistle tomato turquoise violet wheat white whitesmoke yellow yellowgreen

2. rgb() function - Decimal notation

rgb() function accepts values for the red, green and blue. Each one has minimum value of '0' and maximum value of '255'.


Color

Name

rgb()

Black

rgb(0,0,0)

Red

rgb(255,0,0)

Green

rgb(0,255,0)

Blue

rgb(0,0,255)

Yellow

rgb(255,255,0)

Cyan

rgb(0,255,255)

White

rgb(255,255,255)

Dimgray

rgb(105,105,105)


If we set the same values for red, green and blue, it represents gray type color. For example, rgb(200,200,200).

3. #RRGGBB - Hexadecimal notation

The hexadecimal notation of the rgb value consists of '#' character, followed by some number of digits (0-9) or letters (a-f). There might be 6 or 8 digits or letters.

six digits

The three pairs of digits or letters represent red, green and blue colors. For example, #ff0000 is value for red color.

eight digits

There might be eight digits or letters instead of six digits. The fourth pair of digits or letter represents opacity of the object. For example, #ffff0000 is value for yellow color with opacity 0.


Color notation converters

1. Hexadecimal to decimal converter

You can convert hexadecimal value (that consists of 6 letters or digits) to decimal value.

rgb(255,0,255)

2. Decimal to Hexadecimal converter

Put the values of R, G and B to get the value in decimal notation.

#000000

R-

G-

B-

3. RGB value to color converter

Set the values of R, G and B and you'll get the color.

rgb(0,0,0)


R-0

G-0

B-0




Was this article helpful?