Colors in CSS

The color property allows you to specify the color of text inside an element/ the color of background. You can specify any color in CSS in one of these ways:

1. rgb values

An RGB color value is specified with the rgb() function, which has the following syntax: rgb(red, green, blue)

Each parameter (red, green, and blue) defines the intensity of the color and can be an integer between 0 and 255 or a percentage value (from 0% to 100%).

For example, the rgb(0,0,255) value is rendered as blue, because the blue parameter is set to its highest value (255) and the others are set to 0.

Also, the following values define equal color: rgb(0,0,255) and rgb(0%,0%,100%).

### 1.1 rgba = rgb + opacity


2. hex codes


3. color names


4. HSL & HSLA


colorhunt


© Masalha96 GitHub account