LOL!
put a limit on the minimum light values ;) That will solve your issues.
Lights themselves can be between -255 to 255 (rgb)
Ambient light can be between 0 and 255.
Going out of these bounds only causes "glitches" because of how floats,bytes,ints work in RAM. I wnot go there now, but program this:
Into your examples after running your colour decrement.
put a limit on the minimum light values ;) That will solve your issues.
Lights themselves can be between -255 to 255 (rgb)
Ambient light can be between 0 and 255.
Going out of these bounds only causes "glitches" because of how floats,bytes,ints work in RAM. I wnot go there now, but program this:
If R<0 then R=0 If G<0 then G=0 If B<0 then B=0
Into your examples after running your colour decrement.