Optically-addressed two-terminal multicolor photodetector