This project extends the UIColor
class to include class methods for the CCS named colors.
To use the extension simply add UIColor+NamedColors.swift
to your project and call the name of the color you want
as a class method on UIColor
.
view.backgroundColor = UIColor.mediumBlueColor()
Swift Code Generation
The UIColor+NamedColor.swift
file is generated by ruby.
The colors are loaded from the color_names.json
file.
Aliases for colors are selected from the color_aliases.json
file.
The generation is done by the code in generate.rb
.
To generate your own colors, modify color_names.json
and/or colr_aliases.json
and run ruby generate.rb
.