Latest 1.0.0
License MIT
Platforms ios 8.0
Frameworks UIKit, Foundation



To run the example project, clone the repo, and run pod install from the Example directory first.


CSSColors is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "CSSColors"


RGB Initializer

let aliceblue = UIColor.rgb(240, 248, 255)

RGBA Initializer

let aliceblue = UIColor.rgba(240, 248, 255, 0.5)

Basic CSS Colors

let blackColor = UIColor.blackCSSColor()
let silverColor = UIColor.silverCSSColor()
let grayColor = UIColor.grayCSSColor()
let whiteColor = UIColor.whiteCSSColor()
let maroonColor = UIColor.maroonCSSColor()
let redColor = UIColor.redCSSColor()
let purpleColor = UIColor.purpleCSSColor()
let fuchsiaColor = UIColor.fuchsiaCSSColor()
let greenColor = UIColor.greenCSSColor()
let limeColor = UIColor.limeCSSColor()
let oliveColor = UIColor.oliveCSSColor()
let yellowColor = UIColor.yellowCSSColor()
let navyColor = UIColor.navyCSSColor()
let blueColor = UIColor.blueCSSColor()
let tealColor = UIColor.tealCSSColor()
let aquaColor = UIColor.aquaCSSColor()


Updates are planned to add the following enhancements

  • Extended Colors to include all X11 color names.
  • Updated Demo application to include RGB and RGBA initializers.


RGB and RGBA initializers are included as Class methods rather than initializers to avoid conflicts with existing initializers. Basic colors include all basic colors listed in the W3C CSS specification including the ones already provided by UIColor.

Any suggestions for improvements are welcome. Kindly email me at [email protected] or contact me on twitter @jeswinsimon regarding queries and suggestions.


CSSColors is available under the MIT license. See LICENSE for more info.

Latest podspec

    "name": "CSSColors",
    "version": "1.0.0",
    "summary": "UIColor extension for supporting CSS Colors",
    "description": "Extend UIColor to Support CSS Color CodesnCreate UIColor objects with rgb and rgba color codes",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "jeswinsimon": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.0"
    "social_media_url": "",
    "platforms": {
        "ios": "8.0"
    "source_files": "Source/**/*",
    "frameworks": [

Pin It on Pinterest

Share This