averages 9 colors; sort of ugly code