Controlling RGB LED's with sensors

Hi,

I'm using StandardFirmata to bring data into Processing. I've currently got an oscillator which changes based on the values from a photo resistor and once you get to a certain value, an LED switches on. I'm trying to get it so when you move your hand closer to the sensor, it cycles through different colours on the RGB LED.

I was wondering if anyone has any advice on how I go about doing this or if it is even possible?

Many thanks in advance.