Colors Tutorial

Learn JSON  Learn W3.JS  Web Templates  Learn XML DOM  W3.JS Reference  W3.JS Examples  Colors HOME  Color Names  Color Values  Color Groups 

Colors are displayed combining RED, GREEN, and BLUE light.

With CSS, colors can be set by using color names:

With CSS, colors can be specified in different ways:

RGB color values are supported in all browsers.

An RGB color value is specified with: rgb( RED , GREEN , BLUE ).

Each parameter defines the intensity of the color as an integer between 0 and 255.

For example, rgb(0,0,255) is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0.

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

Hexadecimal color values are also supported in all browsers.

A hexadecimal color is specified with: #RRGGBB.

RR (red), GG (green) and BB (blue) are hexadecimal integers between 00 and FF specifying the intensity of the color.

For example, #0000FF is displayed as blue, because the blue component is set to its highest value (FF) and the others are set to 00.

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

You can use upper case or lower case letters to specify hexadecimal values.

Lower case are easier to write. Upper case are easier to read.

CSS supports 140 standard color names.

In the next chapter you will find a complete alphabetical list of color names with hexadecimal values:

HTML, CSS, JavaScript, PHP, jQuery, Bootstrap and XML.

Your message has been sent to W3Schools.

  1. By color names
  2. As RGB values
  3. As hexadecimal values
  4. As HSL values (CSS3)
  5. As HWB values (CSS4)

colorpicker

W3Schools.com