RGB values, HEX values, HSL values, RGBA values, and HSLA values.

rgb rgb(red, green, blue)

colors values between 0 and 255 This means that there are 256 x 256 x 256 = 16777216 possible colors.

rgb(255, 0, 0)

red

rgb(0, 255, 0)

green

rgb(255, 0, 0)

blue

rgb(0, 0, 0)

black

rgb(255, 255, 255)

no color

rgb(0, 255, 255)

rgb(255, 0, 255)

rgb(255, 255, 0)

rgb(256, 256, 256)

255 is not color range


rgba rgba(red, green, blue, alpha)

The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all)

rgba(255, 99, 71, 0)

fully transparent

rgba(255, 99, 71, 0.5)

50% transparent

rgba(255, 99, 71, 1)

not transparent


HEX #RRGGBB

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

#ff0000

red

#00ff00

green

#0000ff

blue

#000000

black

#ffffff

no color


HSL hsl(hue, saturation, lightness)

HSL stands for hue saturation and lightness. Hue is a degree on the color wheel from 0 to 360. 0 is red, 120 is green, and 240 is blue. Saturation is a percentage value, 0% means a shade of gray, and 100% is the full color. Lightness is also a percentage value, 0% is black, and 100% is white.

hsl(0, 100%, 50%)

red

hsl(120, 100%, 50%)

green

hsl(240, 100%, 50%)

blue

hsl(0, 100%, 0%)

black

hsl(0, 100%, 100%)

no color


HSLA hsla(hue, saturation, lightness, alpha)

The alpha parameter is a number between 0.0 (fully transparent) and 1.0 (not transparent at all)

hsla(9, 100%, 64%, 0)

red

hsla(9, 100%, 64%, 0.5)

green

hsla(9, 100%, 64%, 1)

blue



Back to