This is a CircuitPython example. If you’re running our custom MicroPython you should be able to do something like this:
from pimoroni import RGBLED
led = RGBLED(18, 19, 20)
led.set_rgb(255, 0, 0)
Alternatively, if you’re running vanilla MicroPython you could try Tony’s MicroPython example.