You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensionUIColor{convenienceinit(hue:CGFloat, saturation:CGFloat, lightness:CGFloat, alpha:CGFloat= 1.0){precondition(.zero...360.0 ~= hue,"Input hue is out of range 0 to 360")precondition(.zero...1.0 ~= saturation,"Input saturation is out of range 0 to 1")precondition(.zero...1.0 ~= lightness,"Input lightness is out of range 0 to 1")precondition(.zero...1.0 ~= alpha,"Input alpha is out of range 0 to 1")letbrightness= lightness + saturation * min(lightness, 1.0 - lightness)letsaturation= brightness.isZero ?.zero : 2.0 *(1.0 - lightness / brightness)self.init(hue: hue / 360.0, saturation: saturation, brightness: brightness, alpha: alpha)}}
Similar to copy CSS - should be easy: https://stackoverflow.com/a/33800041
The text was updated successfully, but these errors were encountered: