How to Specify Colors

There are three ways to specify a color:

  1. You can use a string (inside quotation marks) that names the color. Here is a list of available colors that you can refer to. For example: "crimson"

  2. You can specify the red, green, and blue components of the exact color that you want to use. Each component can vary in intensity from 0 (none) to 255 (full intensity). You need to put square brackets around the three component values and separate them with commas. For example: [220,20,60]

  3. Any CSS color string. For example: "#D3D3D3" rgba(220, 20, 60, .5)

Last updated