Latest 0.2
License MIT
Platforms ios , requires ARC

A collection of useful methods to extend the funtionality of UIColor.


These replacement methods for the stock colorWith... constructors take integer parameters, like those commonly used in visual design software.

+ (instancetype)colorWithIntegerWhite:(NSUInteger)white;
+ (instancetype)colorWithIntegerWhite:(NSUInteger)white alpha:(NSUInteger)alpha;

+ (instancetype)colorWithIntegerRed:(NSUInteger)red green:(NSUInteger)green blue:(NSUInteger)blue;
+ (instancetype)colorWithIntegerRed:(NSUInteger)red green:(NSUInteger)green blue:(NSUInteger)blue alpha:(NSUInteger)alpha;

+ (instancetype)colorWithIntegerHue:(NSUInteger)hue saturation:(NSUInteger)saturation brightness:(NSUInteger)brightness;
+ (instancetype)colorWithIntegerHue:(NSUInteger)hue saturation:(NSUInteger)saturation brightness:(NSUInteger)brightness alpha:(NSUInteger)alpha;


The COLOR macro simplifies the process of creating semantically-named shared static colors.

@interface UIColor (MyColors)

+ (instancetype)myFavoriteColor;
+ (instancetype)myLeastFavoriteColor;


@implementation UIColor (MyColors)

// The hard way:
+ (instancetype)myFavoriteColor
    static UIColor *_myFavoriteColor;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _myFavoriteColor = [UIColor colorWithRed:0 green:0.75 blue:1 alpha:1];
    return _myFavoriteColor;

// The easy way:
COLOR(myLeastFavoriteColor, [UIColor colorWithRed:0.55 green:0.6 blue:0.4 alpha:1])



UIColor+Categories is available under the MIT License. See the LICENSE file for more info.

Latest podspec

    "name": "UIColor+Categories",
    "version": "0.2",
    "summary": "A collection of useful methods to extend UIColor.",
    "homepage": "",
    "license": "MIT",
    "authors": "Matt Rubin",
    "platforms": {
        "ios": null
    "source": {
        "git": "",
        "tag": "0.2"
    "source_files": "UIColor+Categories",
    "requires_arc": true

Pin It on Pinterest

Share This