Combining Codes

you could make it as u want to but we could suggest rite
ok heres the thing what you want is to make state

pseudo code

if photosensor reading higher/lower(depending of your sensor reading) then set point
fade colour blue
fade colour green
fade colour re
else
turn off all led