RGB multicolor LED controlled by Arduino sensed external voltage

Thank you for displaying the image correctly Mike. Like I said, other components are irrelevant to the LED issue and it is really just distracting from the problem. But to satisfy your curiosity: It is Arduino controlled transistor which in turn switches MOSFET which in turn keeps Arduino circuit and other peripheals (like the BT module - not on the pic) powered on. This specific setup has a nice advantage - you can power on/power off all of the peripheals with one press of the tactile button (the two buttons on the diagram are one button in fact switching between the lines) and also the power consumption of everything in the OFF state is incredibly small (around 1uA which is only a current leaking through MOSFET). But like I have said. This is irrelevant to the LED issue. So let me get to the point:

Arduino senses some external voltage value on some analog pin.
when battery voltage drops below full value (known) the RGB LED start to fade from fully green (Red 0, Green 255, Blue 0) to yellow at 50% of charge (Red 255, Green 255, Blue 0) all the way down to low battery (Red 255, Green 0, Blue 0). Here the Red starts pulsating (pwm function?).

I need to come up with some mathematical function of some sorts that will arduino understand. Also, I need a routine that will switch from red solid color to pulsating solid color at low battery voltage.

I hope this is more understandable now.

A little picture:

Battery reference voltage --------->Arduino-------->RedLED
| |_____>GreenLED
|__________>BlueLED

It's really this simple