HTML and CSS Reference
In-Depth Information
Table 2. Color equivalents
Color
Hexa-decimal
RGB Decimal
RGB Percentage
HSL
#00FFFF
*
aqua
rgb(0,255,255)
rgb(0%,100%,100%)
hsl(180,100%,50%)
black
#000000
*
rgb(0,0,0)
rgb(0%,0%,0%)
hsl(0,0%,0%)
#0000FF
*
blue
rgb(0,0,255)
rgb(0%,0%,100%)
hsl(240,100%,50%)
fuchsia
#FF00FF
*
rgb(255,0,255)
rgb(100%,0%,100%)
hsl(300,100%,50%)
gray
#808080
rgb(128,128,128)
rgb(50%,50%,50%)
hsl(0,0%,50%)
green
#008000
rgb(0,128,0)
rgb(0%,50%,0%)
hsl(120,100%,50%)
lime
#00FF00
*
rgb(0,255,0)
rgb(0%,100%,0%)
hsl(120,100%,50%)
maroon
#800000
rgb(128,0,0)
rgb(50%,0%,0%)
hsl(0,100%,25%)
navy
#000080
rgb(0,0,128)
rgb(0%,0%,50%)
hsl(240,100%,25%)
olive
#808000
rgb(128,128,0)
rgb(50%,50%,0%)
hsl(60,100%,25%)
purple
#800080
rgb(128,0,128)
rgb(50%,0%,50%)
hsl(300,100%,25%)
red
#FF0000
*
rgb(255,0,0)
rgb(100%,0%,0%)
hsl(0,100%,50%)
silver
#C0C0C0
rgb(192,192,192)
rgb(75%,75%,75%)
hsl(0,0%,80%)
teal
#008080
rgb(0,128,128)
rgb(0%,50%,50%)
hsl(180,100%,25%)
white
#FFFFFF
*
rgb(255,255,255)
rgb(100%,100%,100%)
hsl(0,0%,100%)
yellow
#FFFF00
*
rgb(255,255,0)
rgb(100%,100%,0%)
hsl(60,100%,50%)
*
Can be represented using the “short-hex” pattern (e.g., #000).
Angles
Since we just finished talking about hue angles in HSL, this would be a good time to
talk about angle units. Angles in general are represented as
<angle>
, which is a
<num
ber>
followed by one of four unit types:
deg
Degrees, of which there are 360 in a full circle.
grad
Gradians, of which there are 400 in a full circle. Also known as “grades” or “gons.”
rad
Radians, of which there are 2π (approximately 6.28) in a full circle.
turn
Turns, of which there is one in a full circle. This unit is mostly useful when ani-
mating a rotation and you wish to have it turn multiple times, such as
10turn
to
make it spin ten times. (Sadly, the pluralization
turns
is invalid, at least as of
mid-2012.)