I agree with Rob, PWM is the way to go if you already have a microcontroller, but again, I'm not sure of what the stamp basic language can and cannot do.
There should be a PWM command of some sort, which accepts a pin number, duty cycle and duration as arguments. So you'll need three of these commands, and will call them in a loop, or better yet, with a timer driven interrupt.
Here's some pseudo code to get you started:
Setup:
Timer0 period 1ms ' fire timer0 counts to 1ms and then overflows, firing an interrupt
Dim RedValue, GreenValue, BlueValue as Byte
On Interrupt Goto DoPwm
Goto ReadColor 'jump over the interrupt handler
Disable Interrupts 'turn off interrupt checking inside handler routine
DoPwm: ' interrupt handler
Pwm Pin1, RedValue, 2 'pwm your "red" pin for 2 processor cycles
Pwm Pin2, GreenValue, 2 'same for green
Pwm Pin3, BlueValue, 2 'and again for blue
Reset Timer
Reset Interrupt
Resume Program
Enable Interrupts 'turn interrupt checking back on
ReadColor:
Read ColorSensor
Process Results
Delay 5 seconds
Goto ReadColor ' do it all over and over
The hardware side should be pretty straight forward, use transistors to amplify the feeble current from the microcontroller into a more substantial current for driving leds. As Rob points out, you'll most likely need some sort of table mapping sensor readings into accurate colors, the biggest problem will be matching the "brightness", since that is going to be a variable.