Basic colors css

Solo disponible en BuenasTareas
  • Páginas : 2 (460 palabras )
  • Descarga(s) : 0
  • Publicado : 26 de abril de 2011
Leer documento completo
Vista previa del texto
Basic Colors
The following color units () define several different ways to
designate solid colors and can be used for properties like text color,
background-color, and border-color.
#rrggbb or#rgb
In hexadecimal notation, colors are represented by three sets of hexadecimal
values (base-16), with the first set representing the red (r) value, the
second representing the green (g) value, andthe next representing the
blue (b) value based on how displays add light to create the colors you
see. A value of #000000 represents no light (black), #ffffff represents
the most light (white),and #ff0000 represents only red light (bright red).
body { background-color: #999; } /* middle gray */
#rgb is a shorthand for #rrggbb, which is available to use when the two
r characters match, thetwo g characters match, and the two b characters
match (#a3b is equivalent to #aa33bb).
You can also define RGB colors using decimal notation (sometimes called
functional notation)along the same 256-step range (0 to 255) that the
hexadecimal values represented. Each value can also be defined as a
percentage of that 256-step range.
body { background-color: rgb(153,153,153); } /*middle
gray */
body { background-color: rgb(60%,60%,60%); } /* middle
gray */

note You cannot mix integers and percentages in the same color unit designation.
White is rgb(255,255,255) orrgb(100%,100%,100%), but not
The hue-saturation-lightness color scheme offers a way to look at the
color wheel that can be more intuitive when working with colors of asimilar hue or tonality. Hue (h) is a number from 0 to 360 representing
a radial position on the color wheel (0 or 360=red, 120=green, 240=blue).
Saturation (s) is a percentage value from 0 to 100percent with values
closer to 0 percent approaching desaturated, or gray. Lightness (l) is
again a percentage value from 0 to 100 percent, where 0 percent is black
and 100 percent is white.
tracking img