Color Lights

Around the the edge of your board, you notice that there are ten additional LEDs. These LEDs are a bit different than those we've seen before; these are multi-color LEDs.

RGB LEDs

The color LEDs are actually each made up of three smaller LEDs - a Red, a Green, and a Blue. Because of this, we often call these RGB LEDs.

Because there are so many of these LEDs, we've stored them in a list called colorLeds. The first RGB LED in the list (position 0) is located next to the green Power LED, and the rest follow in order counter-clockwise around the board, ending at the 10th RGB LED (position 9) next to the red LED.

Choosing a Color

By default all of the color LEDs will be white when you turn them on. You can set the color of an RGB LED many ways, including using the name of a color (such as "red") a hexadecimal string (like "#FF0000") or using the rgb() command (for example rgb(255, 0, 0)).

If a color LED is off, colorLeds[i].color() will both set the color and turn it on.

Found a bug in the documentation? Let us know at documentation@code.org