Added average color func