Add color attribute in CSS3
CSS color attribute Review
Color name: English names of colors (such as red, blue, pink, and white)
HEX hexadecimal mode (# FF0000, # B9B9B9, etc)
Rgb color scheme (rgb (, 0, 00 ))
These methods are commonly used color attributes, and I use more HEX methods. CSS 3 adds several color attributes.
Add color attribute in CSS3
1. RGBA Mode
2. HSL Mode
3. HSLA Mode
1. RGBA Mode
Rgba has mentioned this in the previous blog. a indicates transparency and the value range is 0 ~ 1. rgb colors are red, green, and blue, respectively. The value ranges from 0 ~ 255.
2. HSL Mode
H: Hue ).
0 (or 360) indicates red, 120 indicates green, 240 indicates blue, and other values can be used to specify the color. Value Range: 0-360
S: Saturation (Saturation ). Value Range: 0.0%-100.0%
L: Lightness (brightness ). Value Range: 0.0%-100.0%
3. HSLA Mode
The HSL mode is the same as the HSL mode. Increase A, that is, transparency.
A: alpha transparency: 0 ~ Between 1
The HSL color wheel is as follows:
For example, an HSLA
Effect:
I personally think that the color of HSL is easier to remember than that of RGB and HEX, but since we all use color Deckers, it is of little significance and we will continue to use RGBA and HEX. HSL and HSLA are just an understanding.