2016年10月17日月曜日

CSS3 Color Values

Color Value

Description and Notes

rgb(red-value, green-value,
blue-value)

RGB (red, green, blue) color model

values can be a number from 0 to 255 or a percentage (but not a combination of numbers and percentages)

rgb(0, 0, 0) and rgb(0%, 0%, 0%) are black

rgb(255, 255, 255) and rgb(100%, 100%, 100%) are white

rgba(red-value, green-value, 
blue-value, alpha)

RGB color model, plus alpha transparency

color values are the same as for RGB syntax

the fourth parameter, alpha, is a decimal greater than or equal to 0.0 (full transparency) and less than or equal to 1.0 (full opacity)

hsl(hue-value, saturation-value, lightness-value)

HSL (hue, saturation, lightness) color model

the hue value is expressed as the angle of a color circle (a number from 0 to 360); 0 and 360 = red, 120 = green, 240 = blue, with other colors represented in between

the saturation value is expressed as a percentage; 0% is gray, and 100% is full saturation of the color

the lightness value is expressed as a percentage; 0% is black, 100% is white, and 50% is "normal"

hsla(hue-value, saturation-value, lightness-value,alpha)

HSL color model, plus alpha transparency

color values are the same as for HSL syntax

the fourth parameter, alpha, is a decimal greater than or equal to 0.0 (full transparency) and less than or equal to 1.0 (full opacity)

 

0 件のコメント:

コメントを投稿