More information added on Hexadecimal colors (#24850)
* More information added on Hexadecimal colors * Added code formatting, reordered changespull/25216/head^2
parent
375e702b57
commit
ebe5ac865e
|
@ -41,10 +41,8 @@ Hexadecimal values are yet another way to define colors in CSS and they work qui
|
|||
|
||||
RR(Red), GG(Green), BB(Blue) are hexadecimal integers between 00 and FF specify the intensity of the color. <br>
|
||||
|
||||
A random hex code would like this: `#29432b`, where the first two characters after the hash stand for the amount of red in the mix, the second two stand for the amount of green and the last two stand for the amount of blue.<br>
|
||||
A random hex code would like this: `#29432b`, where the first two characters after the hash stand for the amount of RED in the mix, the second two stand for the amount of Green and the last two stand for the amount of Blue. Unlike RGB color mixture where the values are in base 10, Hexadecimal color codes use base 16, or hexadecimal base, to specify color mixtures.
|
||||
|
||||
The values of `#000000` and `#ffffff` stand for black and white respectively.<br>
|
||||
You can find the specific hexadecimal colors you require by using the same tools mentioned for the RGB values.
|
||||
|
||||
### Syntax
|
||||
|
||||
|
@ -53,8 +51,27 @@ p {
|
|||
color: #00fe00;
|
||||
}
|
||||
```
|
||||
|
||||
This rule again changes the font color of all p elements to green.
|
||||
|
||||
The values of `#000000` and `#ffffff` stand for black and white respectively.
|
||||
|
||||
When a hex color code is composed of entirely of the same characters, the hex color can be abbreviated, like this:
|
||||
|
||||
```css
|
||||
h1 {
|
||||
color: #FFFFFF;
|
||||
color: #FFF; /* This is the same color as above */
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #FF33AA;
|
||||
color: #F3A; /* This is the same color as above */
|
||||
}
|
||||
```
|
||||
|
||||
You can find the specific Hexadecimal colors you require by using the same tools mentioned for the RGB values. <br>
|
||||
|
||||
### HSL
|
||||
|
||||
HSL has three values. <br>
|
||||
|
|
Loading…
Reference in New Issue