Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML HEX Colors


A hexadecimal color is specified with: #RRGGBB, where the RR (red), GG (green) and BB (blue) hexadecimal integers specify the components of the color.


HEX Color Values

In HTML, a color can be specified using a hexadecimal value in the form:

#rrggbb

Where rr (red), gg (green) and bb (blue) are hexadecimal values between 00 and ff (same as decimal 0-255).

For example, #ff0000 is displayed as red, because red is set to its highest value (ff) and the others are set to the lowest value (00).

Experiment by mixing the HEX values below:

 

RED

ff

GREEN

0

BLUE

0

Example

#ff0000
#0000ff
#3cb371
#ee82ee
#ffa500
#6a5acd

Try it Yourself »

Shades of gray are often defined using equal values for all the 3 light sources:

Example

#000000
#3c3c3c
#787878
#b4b4b4
#f0f0f0
#ffffff

Try it Yourself »