Not sure this is possible, but looking to write a script that would return the average hex
or rgb
value for an image. I know it can be done in AS
This is about "Color Quantization" that has several approachs like MMCQ (Modified Median Cut Quantization) or OQ (Octree Quantization). Different approach use K-Means to obtain clusters of colors.
I have putted all together here, since I was finding a solution for tvOS
where there is a subset of XHTML, that has no element:
Generate the Dominant Colors for an RGB image with XMLHttpRequest