4.1 Styling with CSS: Colors

Foreground color

the color that an element appears in.

background-color

this property styles an element's background color.

color

this property styles an element's foreground color.

named colors

there are a total of 147 of these colors in CSS.
ex: Crimson, DarkMagenta, Blue, Red, etc.

RGB colors

offer the option of 16,777,216 possible colors by mixing together different amounts of red (R), green (G), and blue (B). Values are between 0 and 255.

rgb()

a value that can be used to make colors. requires three numbers in the parenthesis that represent the values for R, G, and B, in that order.
ex: (54, 74, 101);

hex color codes

hex short for hexadecimal. offers 16,777,216 color options. use base 16 to specify color mixtures. All codes begin with the # character.
ex: #09AA34 (09 red, AA green, 34 blue)
can be abbreviated when a value is composed of entirely of the same characters

HSL

stands for Hue, Saturation, and Lightness. not supported by older browsers.

Hue

describes what we understand as "color." In HSL, it is represented on a color wheel. It can take on values between 0 and 360.

Saturation

the amount of gray in a given color. In HSL, saturation is specified using a percentage between 0% and 100%.

Lightness

the amount of white in a given color. 0% represents black, 100% represents white

Opacity

measure of how transparent a color is. used with the rgba() value.

alpha value

represent by the character a in rgba() and hsla(). represents the opacity of a color. value can be a value between 0 and 1. 1 is solid, 0 max transparent.