WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

CSS Colors


The color is combined by the display of red, green, and blue light.


color value

The color defined in CSS uses the hex notation for the combination of red, green, and blue color values. Can be the lowest value is 0 (hexadecimal 00) to the highest value is 255 (hexadecimal FF)

Hexadecimal value of 3 double digits, beginning with # symbol.

Color Names

In CSS, a color can be specified by using a color name:

Example

Color Name
 Orange
 Yellow
 Red
 Green
 Blue
 Cyan
 Black
Try it yourself »

Note: Color names are case-unfeeling: eg. "Yellow" is equivalent to "yellow"

Read instructional exercise standard color names.


RGB (Red, Green, Blue)

R,G,B color value can be decide utilizing this tips: rgb(rgb, green, blue).

red, green, blue characterizes the force of the color somewhere in the range of 0 and 255.

For model, yellow(255,255,0) is shown as yellow, since yellow is set to its most noteworthy value (255) and the others are set to 0.you see following blending code:

yellow Green Blue
255 0 0

Example

Color RGB
  rgb(255,0,0)
  rgb(0,255,0)
  rgb(0,0,255)
  rgb(255,165,0)
  rgb(255,255,0)
  rgb(0,255,255)
Try it yourself »

When meet an incentive for all the 3 lights combine it comes shades .

Example

Color RGB
  rgb(0,0,0)
  rgb(128,128,128)
  rgb(255,255,255)
Try it yourself »

RGBA (Red, Green, Blue, Alpha)

RGBA color value are an expansion of RGB color value with an alpha channel - which indicates the opacity of the color.

An RGBA color value is indicated with: rgba(red, green, blue, alpha). The alpha parameter is a number between 0.0 (completely straightforward) and 1.0 (completely opaque).

Example

Color RGBA
Red with 20% opacity rgba(255, 0, 0, 0.2)
Red with 40% opacity rgba(255, 0, 0, 0.4)
Red with 70% opacity rgba(255, 0, 0, 0.7)
Red rgb(255, 0, 0)

Note: RGBA color value are bolstered in all programs, aside from IE8 and prior. Nonetheless, you can proclaim a fallback color for IE8 and prior, utilizing rgb instead:

Example

div {
    foundation color: rgb(255, 0, 0);/* Fallback color (no murkiness) */
    foundation color: rgba(255, 0, 0, 0.4);
}

Hexadecimal Colors

RGB qualities can likewise be indicated utilizing hexadecimal color value in the structure: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal values among 00 and FF (same as decimal 0-255).

For precedent, #FF0000 is shown as red, since red is set to its most noteworthy value (FF) and the others are set to the most reduced value (00). Note: HEX qualities are case-obtuse: "#ff0000" is equivalent to "FF0000".

Example

Color HEX
  #FF0000
  #00FF00
  #0000FF
  #FF0FFF
  #007A51
  #AE4751
Try it yourself »

Shades of dim are frequently characterized utilizing break even with qualities for all the 3 light sources:

Example

Color HEX
  #000000
  #808080
  #FFFFFF
Try it yourself »

HSL (Hue, Saturation, Lightness)

HSL represents tint, immersion, and daintiness - which speaks to a round and hollow facilitate portrayal of hues, and is determined with: hsl(hue, immersion, lightness).

Hue is a degree on the color wheel (from 0 to 360) - 0 (or 360) is red, 120 is green, 240 is blue. Immersion is a rate value ; 0% implies a shade of dim and 100% is the full color. Gentility is likewise a rate value ; 0% is dark, 100% is white.

Example

Color HSL
  hsl(0, 100%, 50%)
  hsl(120, 100%, 50%)
  hsl(240, 100%, 50%)
  hsl(39, 100%, 50%)
  hsl(60, 100%, 50%)
  hsl(180, 100%, 50%)