🎨
graphics.js
  • Welcome!
  • Quick Start
  • How to Specify Colors
  • API Reference
    • Fundamental
    • Drawing
    • Image
    • Sound
    • Mouse
    • Keyboard
    • Time
    • Math
    • Miscellaneous
Powered by GitBook
On this page

How to Specify Colors

PreviousQuick StartNextFundamental

Last updated 2 years ago

There are three ways to specify a color:

  1. You can use a string (inside quotation marks) that names the color. Here is a 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)

list of available colors