well, it estimates the color, if anyone knows how to make this more accurate please say :D it seems to be very close except saturation doesn't seem to be quite right.
Notes & Credits
adjust the variables and change the one on the right to see how close it is