An extension to the UIColor class in swift.
The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:
The primary function of the Rainbow UIColor extension is to provide developers with more colour choices within their applications. Apple provides a limited number of pre-defined colours such as UIColor.blackColor() and UIColor.greenColor(). This library adds over 1500 more colours to be used. I think it makes code much easier to read and much more understandable when someone comes across
let backgroundColour = UIColor.airForceBlueRAFColor()
versus having to use the RGB values
let backgroundColour = UIColor ( red: 93.0/255.0, green: 138.0/255.0, blue: 168.0/255.0, alpha: 1.0 )
Except for some obvious cases I'm not very good at looking at RGB values and determining what they will display.
The other function of the extension is to provide a helper function for the UIColor class that allows you to create color instances using Int values between 0 and 255 for the RBG values. The value for the opacity (alpha) has a default value of 1.0.
As of May 7, 2015 I've release a set of files that you can download called Rainbow-Palettes which will add the colours defined in this library to the colour picker in Xcode.
To use the library download the file you want and import it into your project. If you don't want all of colours then choose one of the subsets. I will try to make sure that multiple subsets can be used together. If you encounter a problem please let me know.
If you can't find a colour in the library then take a look at the Rainbow Creator UIColor extension that allows you to create custom colours using Int values between 0 and 255 or hexidecimal values. (It was part of this repository but I moved it into it's own to get ready for CocoaPods and Carthage support.)
In the short term I hope to release an app that will let you view the colours and perform searching. I am continuing work on the app. If anyone knows of a good library that lets you choose a colour from a colour wheel or something similar I would appreciate hearing about it.
In the longer term I want to add more colours to the library, either individually or through collections. Ideally it would be great to get one or more of the paint manufacturers to give their permission to use their their palette. I know that Pantone would achive the same thing but it would cost money to get the information and they would probably be opposed to it being publicly posted. All information for the colours was obtained from Wikipedia. I cleaned up any broken links or incorrect information that I came across while working on this project. If you contribute a colour to the library please also let me know if I can add it to the list of colours on Wikipedia.
In the meantime you can view the colours at Wikipedia where I got the data for all of the colours at the pages.
If you find a problem, want to suggest a colour (or know someone I could approach about asking to use their colour set), suggest how something that can be done differently, or even say hi you can reach me on @NrthrnRealities on Twitter.
I am terribly sorry about mixing up the spellings of colour and color. I'm from Canada and we spell it with the 'u' and I can't get out of the habit. However when it comes to function names, parameters, and other cases when it really counts I've strived to go against my instincts and spelt it without the extra letter as per the Apple standard. In other cases I've allowed myself to spell it the proper way. :) Please forgive me my little indulgence.