One approach, no need to introduce voltage analog values (single chip) :
Basically PWM produces duty cycle desired for LED. When it is updated also a
value is written to the compare side of the digital comparators, that is compared
against the preset compare value trip points, and appropriate channel activated to
steer PWM value to appropriate LEDs. I did not show current source in the channel,
you would add that to the mosfet/led channel.
~ 10 lines of code needed, and this is a 1 chip solution. Note a lot of other resources left
for use, see right hand window for resources remaining/available.
Other stuff available on this chip, multiple copies in many cases :
I could use your approach, create analog value, then use onchip A/D to test for
threshold value, either way 1 chip solution except for current source and external LEDs
and MOSFETs.
Dev board ~ $15, IDE (PSOC Creator) and compiler free.
Regards, Dana.