function for finding modulus of a color