Wednesday, January 4, 2012

CSS: Values: Colors: RGB

By Richard York

RGB Colors

RGB stands for Red, Green, and Blue. These are the primary colors used to display the color of pixels on a computer monitor. When you use these three colors in various combinations, it is possible to create every color of the rainbow. This is done through different colored lights either overlapping each other or appearing side by side in different intensities to display color. RGB is also known as luminous or additive color. Luminous means that RGB uses light in varying intensities to create color, and additive means colors are added to one another to produce the colors of the spectrum. Many computer monitors are capable of displaying millions of colors: 16,777,216 colors, in fact. CSS RGB color is specified using a special three-number syntax, with each one representing a color channel. This first number is red, the second green, and the third blue:
This also produces the same color as the CSS color keyword gray.
CSS 3 is to introduce one more variation on the RGB scheme, with RGBA. This specification includes an alpha channel, which is used to make an element transparent. The alpha channel of RGBA is specified in the same manner as regular RGB with the A indicating how transparent the color is, with 0 being fully opaque, and 255 being fully transparent. No browser supports the RGBA specification yet.
RGB color is also often specified in hexadecimal format.

Post a Comment