I think you nearly have it.
And good on your trying.
So you are starting with 255, 100, 100 in your example.
You reduce all three values by one on each pass, with a pause so "we" get to see the colour.
But you run into the problem when G and B (in your example) get to 0.
Well, let's think about it one step back.
156, 1, 1 (RGB)
That is the "colour" you wanted. with the same RGB proportions as when you started out.
Brain storming here, so forgive me if I am not 100% correct. It is just putting ideas/suggestions on the table.
Instead of the IF(red > 0) (red --1);
Try:
[code]
void loop()
{
//Red
if (red > 1) {red--;}
//Green
if (green > 1) {green--;}
//Blue
if (blue > 1) {blue--;}
//
delay(15);
updateLED();
}
This looks a bit strange, but indulge me.
It will start with your values, and reduce them by one each pass but NOT take them to 0.
Then, it will keep the "mixture" the same but then it will keep reducing the other values until they all get to one.
I'm not sure how good with colours are for the ratio but at least it may hold the colour better than taking the LED to ZERO.
Your example is not that good in that it is 255, 100, 100.
Try with three different values also.
Another question is this:
When is the colour NOT the colour?
Say in your example it is 255, 100, 100.
I can't remember the name of that colour, but anyway.....
Is 151, 1, 1 the same colour?
Is 150, 0, 0 the same colour?
If the second is NO, then you have to stop at the 151, 1, 1 line.
Anyway, it is more your perception of the colour/s that is important.
I hope this has helped a bit.
Good luck and keep trying.
[/code]