Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
UIColor+Custom
//
// UIColor+Custom.h
//
// Created by TheFinestArtist
//
#import <Foundation/Foundation.h>
@interface UIColor (Custom)
+ (UIColor *)navy:(CGFloat)alpha;
+ (UIColor *)cyan:(CGFloat)alpha;
+ (UIColor *)white:(CGFloat)alpha;
+ (UIColor *)grey:(CGFloat)alpha;
+ (UIColor *)silver:(CGFloat)alpha;
+ (UIColor *)black:(CGFloat)alpha;
+ (UIColor *)red:(CGFloat)alpha;
@end
//
// UIColor+Custom.m
//
// Created by TheFinestArtist
//
#import "UIColor+Custom.h"
@implementation UIColor (Custom)
+ (UIColor *)navy:(CGFloat)alpha {
return [UIColor colorWithRed:0 green:0.447 blue:0.69 alpha:alpha];
}
+ (UIColor *)cyan:(CGFloat)alpha {
return [UIColor colorWithRed:0.20 green:0.71 blue:0.898 alpha:alpha];
}
+ (UIColor *)grey:(CGFloat)alpha {
return [UIColor colorWithRed:0.914 green:0.914 blue:0.969 alpha:alpha];
}
+ (UIColor *)black:(CGFloat)alpha {
return [UIColor colorWithRed:0.098 green:0.098 blue:0.153 alpha:alpha];
}
+ (UIColor *)silver:(CGFloat)alpha {
return [UIColor colorWithRed:0.427 green:0.427 blue:0.482 alpha:alpha];
}
+ (UIColor *)white:(CGFloat)alpha {
return [UIColor colorWithRed:0.945 green:0.945 blue:1.00 alpha:alpha];
}
+ (UIColor *)red:(CGFloat)alpha {
return [UIColor colorWithRed:0.757 green:0.153 blue:0.176 alpha:alpha];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.