Access the overall average color from the material icon?

Is there a way to programmatically access the overall average RGB color from the material icon?

This is a forum for Blender development. For questions about using Blender, feature requests and bugs, please use the links above. Forum rules.