Skip to content

Instantly share code, notes, and snippets.

@jplazcano87
Last active November 23, 2015 01:04
Show Gist options
  • Save jplazcano87/3eea45eb2353356fedb2 to your computer and use it in GitHub Desktop.
Save jplazcano87/3eea45eb2353356fedb2 to your computer and use it in GitHub Desktop.
How to add UIColor extensions in swift
import Foundation
import UIKit
extension UIColor{
//create a class function with the name of the custom color
class func lazcolor() -> UIColor {
return UIColor(red: 190.0/255.0, green: 190.0/255.0, blue: 190.0/255.0, alpha: 1.0)
}
class func grayScaleColor(grayScale : CGFloat) -> UIColor {
return UIColor(red: grayScale/255.0, green: grayScale/255.0, blue: grayScale/255.0, alpha: 1.0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment