This is an example of code library.
The method to calculate color is below:
1) The library can grasp the color data in pixel and save it.
2) Using a tolerance number to decide the contrast
3) Save the number of color being record
4) showing them on the screen