0
CSS uses Hexadecimal or Numerical values to specify a color. These are used to set the color of the background or foreground of an element(i.e., its text). It can also be used to impart  color to the borders and other decorative effects.

Colors in CSS can be specified in various formats. Following table tells you all possible formats:
Format Syntax Example
Hex Code #RRGGBB p {color:#FF0000;}
Short Hex Code #RGB p {color:#6A7;}
RGB % rgb(rrr%,ggg%,bbb%) p{color:rgb(50%,50%,50%);}
RGB Absolute rgb(rrr,ggg,bbb) p {color:rgb(0,0,255);}
keyword aqua, black, etc. p {color:teal;}

These formats are explained in more detail in the following sections:

CSS Colors - Hex Codes:

A hexadecimal is a 6 digit representation of a color.
first two digits(RR) represent a red valu.
next two digits(GG) represent a green value.
last  two digits(BB) represent a blue value.
A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro or even using Advanced Paint Brush.
Each hexadecimal code will be preceded by a hash sign #.
Examples to use Hexadecimal notation. #66AA77, #4488DD
Play with our Hexdecimal Color Code wheel 

CSS Colors - Short Hex Codes:

This is a shorter form of the six-digit notation. In this format, each digit is replicated to arrive at an equivalent six-digit value; For example: #6A7 becomes #66AA77.
A hexadecimal value can be taken from any graphics software like Adobe Photoshop, Jasc Paintshop Pro or even using Advanced Paint Brush.
Each hexadecimal code will be preceded by a pound or hash sign #.
Examples to use Hexadecimal notation. #6A7, #48D

CSS Colors - RGB Values:

This color value is specified using the rgb( ) property. This property takes three values, one each for red, green, and blue. The value can be an integer between 0 and 255 or a percentage.

NOTE: All the browsers does not support rgb() property of color so it is recommended not to use it.
Following is the example to show few colors using RGB values.
Create Hexadecimal color code on your own using our Hexadecimal Color Codes Tool

Building Color Codes:

You can build millions of color codes using our Color Picker. Check out our Color Picker. To use this tool you would need a Java Enabled Browser.

Browser Safe Colors:

There are about 216 colors which are supposed to be most safe and computer independent colors. These colors very from hexa code 000000 to FFFFFF. These color are safe to use because they ensure that all computers would display the colors correctly when running a 256 color palette:
Check out all the 216 colors - Color Chart

Post a Comment

 
Top