2. Colors #
Created Monday 15 June 2020
There are three ways to define color:
- rgb(r,g,b) - where 0 ≤r, g, b ≤ 255.
- #pqrstu - 0≤ all values ≤ f
- Names - blue, green, fuchsia
- hsl(hue, saturation, lightness) - hue ∈ [0, 360), saturation ∈ [0, 100], lightness ∈ [0, 100]
- hsla(hue, saturation, lightness, alpha) - for transparency
Notes:
- For grayscale - use the same color for all red, green and blue.
- There are about 140 names supported by HTML/CSS
- **rgba(r,g,b, alpha) **is used 0≤α≤1 to allow transparency with alpha = 1 being the most opaque. It’s got nothing to do with the rgb values.
- Shortened hex(only some cases such as #AABBCC becomes #ABC)