set Pixel Color

Set the color of the pixel at this location to a new color.

light.setPixelColor(0, 0)

Parameters

  • pixelOffset: the position on the strip (or the board) of the pixel whose color you want to change.
  • color: an RGB color to change the pixel to.

Example

When button B is clicked, show the pink color at pixel 0 on the ring.

input.buttonB.onEvent(ButtonEvent.Click, () => {
    light.setPixelColor(0, 0xff007f)
})

See Also

||pixel color||, ||rgb||

circuit-playground