Last active
April 29, 2022 11:32
-
-
Save vladimir-anisimov/adc705a7244e006c920556d4cdf95b84 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIColor { | |
var redValue: CGFloat{ return CIColor(color: self).red } | |
var greenValue: CGFloat{ return CIColor(color: self).green } | |
var blueValue: CGFloat{ return CIColor(color: self).blue } | |
var alphaValue: CGFloat{ return CIColor(color: self).alpha } | |
convenience init(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat = 1) { | |
self.init(red: r / 255, green: g / 255, blue: b / 255, alpha: a) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment