Flat Colors UIColor extension

extension UIColor { class func flatRed() -> UIColor{ return UIColor(red:0.93, green:0.29 ,blue:0.25 , alpha:1.00) } class func flatRedDark() -> UIColor{ return UIColor(red:0.77, green:0.22 ,blue:0.19 , alpha:1.00) } class func flatOrange() -> UIColor{ return UIColor(red:0.92, green:0.49 ,blue:0.22 , alpha:1.00) } class func flatOrangeDark() -> UIColor{ return UIColor(red:0.84, green:0.32 ,blue:0.11 , alpha:1.00) } class func flatYellow() -> UIColor{ return UIColor(red:1, green:0.80 ,blue:0.26 , alpha:1.00) } class func flatYellowDark() -> UIColor{ return UIColor(red:1, green:0.65 ,blue:0.22 , alpha:1.00) } class func flatSand() -> UIColor{ return UIColor(red:0.95, green:0.87 ,blue:0.72 , alpha:1.00) } class func flatSandDark() -> UIColor{ return UIColor(red:0.84, green:0.76 ,blue:0.60 , alpha:1.00) } class func flatNavy() -> UIColor{ return UIColor(red:0.20, green:0.29 ,blue:0.36 , alpha:1.00) } class func flatNavyDark() -> UIColor{ return UIColor(red:0.17, green:0.24 ,blue:0.31 , alpha:1.00) } class func flatBlack() -> UIColor{ return UIColor(red:0.17, green:0.17 ,blue:0.17 , alpha:1.00) } class func flatBlackDark() -> UIColor{ return UIColor(red:0.15, green:0.15 ,blue:0.15 , alpha:1.00) } class func flatTeal() -> UIColor{ return UIColor(red:0.21, green:0.44 ,blue:0.50 , alpha:1.00) } class func flatTealDark() -> UIColor{ return UIColor(red:0.19, green:0.38 ,blue:0.44 , alpha:1.00) } class func flatGreen() -> UIColor{ return UIColor(red:0.0, green:0.80 ,blue:0.48 , alpha:1.00) } class func flatGreenDark() -> UIColor{ return UIColor(red:0.0, green:0.68 ,blue:0.41 , alpha:1.00) } class func flatMint() -> UIColor{ return UIColor(red:0.0, green:0.74 ,blue:0.62 , alpha:1.00) } class func flatMintDark() -> UIColor{ return UIColor(red:0.0, green:0.63 ,blue:0.53 , alpha:1.00) } class func flatWhite() -> UIColor{ return UIColor(red:0.93, green:0.94 ,blue:0.95 , alpha:1.00) } class func flatWhiteDark() -> UIColor{ return UIColor(red:0.74, green:0.76 ,blue:0.78 , alpha:1.00) } class func flatGray() -> UIColor{ return UIColor(red:0.58, green:0.65 ,blue:0.65 , alpha:1.00) } class func flatGrayDark() -> UIColor{ return UIColor(red:0.49, green:0.55 ,blue:0.55 , alpha:1.00) } class func flatForest() -> UIColor{ return UIColor(red:0.19, green:0.37 ,blue:0.27 , alpha:1.00) } class func flatForestDark() -> UIColor{ return UIColor(red:0.16, green:0.31 ,blue:0.22 , alpha:1.00) } class func flatPurple() -> UIColor{ return UIColor(red:0.47, green:0.37 ,blue:0.75 , alpha:1.00) } class func flatPurpleDark() -> UIColor{ return UIColor(red:0.36, green:0.29 ,blue:0.62 , alpha:1.00) } class func flatBrown() -> UIColor{ return UIColor(red:0.37, green:0.27 ,blue:0.21 , alpha:1.00) } class func flatBrownDark() -> UIColor{ return UIColor(red:0.32, green:0.23 ,blue:0.18 , alpha:1.00) } class func flatPlum() -> UIColor{ return UIColor(red:0.38, green:0.20 ,blue:0.36 , alpha:1.00) } class func flatPlumDark() -> UIColor{ return UIColor(red:0.32, green:0.17 ,blue:0.30 , alpha:1.00) } class func flatWatermelon() -> UIColor{ return UIColor(red:0.96, green:0.44 ,blue:0.48 , alpha:1.00) } class func flatWatermelonDark() -> UIColor{ return UIColor(red:0.87, green:0.33 ,blue:0.36 , alpha:1.00) } class func flatLime() -> UIColor{ return UIColor(red:0.64, green:0.77 ,blue:0.33 , alpha:1.00) } class func flatLimeDark() -> UIColor{ return UIColor(red:0.54, green:0.69 ,blue:0.25 , alpha:1.00) } class func flatPink() -> UIColor{ return UIColor(red:0.98, green:0.49 ,blue:0.75 , alpha:1.00) } class func flatPinkDark() -> UIColor{ return UIColor(red:0.85, green:0.36 ,blue:0.61 , alpha:1.00) } class func flatMaroon() -> UIColor{ return UIColor(red:0.49, green:0.18 ,blue:0.17 , alpha:1.00) } class func flatMaroonDark() -> UIColor{ return UIColor(red:0.41, green:0.15 ,blue:0.14 , alpha:1.00) } class func flatCoffee() -> UIColor{ return UIColor(red:0.64, green:0.53 ,blue:0.45 , alpha:1.00) } class func flatCoffeeDark() -> UIColor{ return UIColor(red:0.46, green:0.45 ,blue:0.38 , alpha:1.00) } class func flatPowder() -> UIColor{ return UIColor(red:0.72, green:0.79 ,blue:0.93 , alpha:1.00) } class func flatPowderDark() -> UIColor{ return UIColor(red:0.60, green:0.67 ,blue:0.82 , alpha:1.00) } class func flatBlue() -> UIColor{ return UIColor(red:0.31, green:0.40 ,blue:0.62 , alpha:1.00) } class func flatBlueDark() -> UIColor{ return UIColor(red:0.22, green:0.30 ,blue:0.49 , alpha:1.00) } class func flatSky() -> UIColor{ return UIColor(red:0.16, green:0.60 ,blue:0.84 , alpha:1.00) } class func flatSkyDark() -> UIColor{ return UIColor(red:0.13, green:0.51 ,blue:0.71 , alpha:1.00) } func adjust(red: CGFloat, green: CGFloat, blue: CGFloat, alpha:CGFloat) -> UIColor{ var r: CGFloat = 0, g: CGFloat = 0, b: CGFloat = 0, a: CGFloat = 0 self.getRed(&r, green: &g, blue: &b, alpha: &a) return UIColor(red: r+red, green: g+green, blue: b+blue, alpha: a+alpha) } }
Some nice colors with simple access:

//Example:
myView.backgroundColor = UIColor.flatBlue()

//Color credit to Howard Smith
//Find the palette here: https://howardsmithdmd.wordpress.com/2014/12/16/development-realisation-assignment-influences-2/

3 Responses

Nice method, could you please add a link of the color palette just to see it?
@Kevin Rodríguez Good point, added a link!
@Timothy Krechel Nice, thanks!

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.