Just use three photo sensors each one having a different (RGB) color filter. This will give you three independent values representing the amount of each color that is being emitted / reflected by the object. You then use those values to display the color on your screen.Note: The colors will not be very accurately displayed because your eyes, the photo sensors, the illumination source, and the display are not very linear.