---
tag: m0150
title: Set RGB(W) Color
brief: Set the color of the RGB(W) LED, backlight, or LED strip.
author: thinkyhead

group: lcd
requires: BLINKM|RGB_LED|RGBW_LED|NEOPIXEL_LED|PCA9632

codes: [ M150 ]

parameters:

- tag: R
  optional: true
  description: Red component from 0 to 255
  values:
  - tag: intensity
    type: int

- tag: U
  optional: true
  description: Green component from 0 to 255
  values:
  - tag: intensity
    type: int

- tag: B
  optional: true
  description: Blue component from 0 to 255
  values:
  - tag: intensity
    type: int

- tag: W
  optional: true
  requires: RGBW_LED | NEOPIXEL_LED
  description: White component from 0 to 255
  values:
  - tag: intensity
    type: int

- tag: P
  optional: true
  requires: NEOPIXEL_LED
  description: Brightness from 0 to 255
  values:
  - tag: intensity
    type: int

- tag: I
  since: 2.0.6
  optional: true
  requires: NEOPIXEL_LED
  description: NeoPixel pixel index (0 .. pixels-1)
  values:
  - tag: pixel
    type: int

- tag: S
  since: 2.0.6.1
  optional: true
  requires: NEOPIXEL2_SEPARATE
  description: NeoPixel strip index (0 or 1)
  values:
  - tag: strip
    type: int

- tag: K
  optional: true
  type: flag
  requires: NEOPIXEL_LED
  description: Keep all unspecified values unchanged

examples:

- pre: Set LEDs to blue with brightness 30
  code: M150 B30

- pre: Set NeoPixel 0 to red with brightness 100
  code: M150 R100 I0

- pre: Set NeoPixel 1 to green with brightness 45
  code: M150 U45 I1

- pre: Set the second NeoPixel strip full white
  code: M150 W255 S1

- pre: Change red to 50% without changing other components
  code: M150 K R127

---

If you have an RGB(W) light, either as part of a controller or installed separately, the `M150` command can be used to set its color.
