Added max function to get the max color value