I was looking around for information on the GPIO connected to the RGB LED on the expansion dock, didn't find any, so I tried to traced back using a multimeter. Below is the connection, please correct me if I'm wrong, otherwise at least this should help the next guy looking for it.
1kOhm current limiting resistors are connected to each pin
LED R - GPIO17
LED G - GPIO16
LED B - GPIO15
Set GPIO to 0 to turn on and 1 to turn off. I'm guessing the invert is because most GPIO have better sinking capability than sourcing. I would have expect a slightly different resistor value, especially for Red as each color have different luminosity and to achieve a better "white" when all are turned on.
Below is some code to get started
#Setup export and GPIO direction
echo 17 > /sys/class/gpio/gpiochip0/subsystem/export
echo 16 > /sys/class/gpio/gpiochip0/subsystem/export
echo 15 > /sys/class/gpio/gpiochip0/subsystem/export
echo out > /sys/class/gpio/gpio17/direction
echo out > /sys/class/gpio/gpio16/direction
echo out > /sys/class/gpio/gpio15/direction
#turn off RGB LED
echo 1 > /sys/class/gpio/gpio17/value
echo 1 > /sys/class/gpio/gpio16/value
echo 1 > /sys/class/gpio/gpio15/value
#turn on R
echo 0 > /sys/class/gpio/gpio17/value
#turn on G
echo 0 > /sys/class/gpio/gpio16/value
#turn on B
echo 0 > /sys/class/gpio/gpio15/value