Last active
June 25, 2018 06:57
-
-
Save yashthaker7/f38d77406804b24e6708377fd2ef14f3 to your computer and use it in GitHub Desktop.
UIColor+Extension.swift
This file contains 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 { | |
convenience public init(r: CGFloat, g: CGFloat, b: CGFloat) { | |
self.init(r: r, g: g, b: b, a: 1) | |
} | |
convenience public init(r: CGFloat, g: CGFloat, b: CGFloat, a: CGFloat) { | |
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