Algorithmic Multi-Color Cmos Avalanche Photodiodes For Smart-Lighting Applications