Add color variation calculating function to items