CSS RGB Colors
- Previous Page CSS Colors
- Next Page CSS HEX Colors
RGB values
In CSS, the following formula can be used to specify colors as RGB values:
rgb(green blue
each parameter (green, as well as blue) defines color intensity between 0 and 255.
For example, rgb(255, 0, 0) is displayed as red because red is set to the maximum value (255), and the others are set to 0.
To display black, set all color parameters to 0 as shown below: rgb(0, 0, 0).
To display white, set all color parameters to 255 as shown below: rgb(255, 255, 255).
Please experiment by mixing the following RGB values:
RED
GREEN
BLUE
Example
通常 for all three light sources, equal values are used to define gray shadows:
Example
RGBA values
RGBA color values are an extension of RGB color values with an alpha channel - it specifies the opacity of the color.
RGBA color values are specified as:
rgba(green blue alpha
alpha The parameters are numbers between 0.0 (fully transparent) and 1.0 (fully opaque):
Please experiment by mixing the following RGBA values:
RED
GREEN
BLUE
ALPHA
Example
- Previous Page CSS Colors
- Next Page CSS HEX Colors