Foreground Colors in CSS
there are many ways of representing colors in css and basically in writing code but one of the more traditional models is the RGB model.
- Every single color can be represented by any combination of red, green and blue colors.
- in order to actually represent a certain color we need to give each of the three base colors any value between zero and 255.
- This way, we can define a total of 16.8 million different colors.
- in white we have all the three colors at the maximum of 255.
- When we have all the colors at zero we get a complete black color.
Notations
We have two ways of writing colors using the RGB model and those are the
- RGB notation
- Use this RGB function in CSS. Simply specify the values for each of the three color channels, red, green, and blue.
- RGB with transparency, and transparency is also called alpha.
- That's why this function is called RGBA.
- Hexadecimal notation.
- Use a scale from zero to ff and ff is basically the same as 255 but in a hexadecimal scale.
- Shothand Notation
- when all the colors are identical pairs.
- Use a scale from zero to ff and ff is basically the same as 255 but in a hexadecimal scale.
Shades of Grey Color
- When the three colors in the three channels are exactly the same what we get is a grey color.
- There are exactly 256 pure grays to choose from.
Color CSS
- Using a color value in simply the color property,
- We can change the notation type by clicking on notaion in color pop up winodw
- Use Slider to to change Alphpa value for RGBA
Just Hover over the color to see the color picker