Skip to content

Instantly share code, notes, and snippets.

@Sephiroth-XIII
Last active August 29, 2015 14:13
Show Gist options
  • Save Sephiroth-XIII/96e163bd5d98bf50ec35 to your computer and use it in GitHub Desktop.
Save Sephiroth-XIII/96e163bd5d98bf50ec35 to your computer and use it in GitHub Desktop.
Simple way to minimize the effort while defining color palette for an app.
#import "UIColor+MyApp.h"
@implementation UIColor(MyApp)
+(UIColor *)RGB:(long)hex A:(float)a {
return [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 green:((float)((hex & 0xFF00) >> 8))/255.0 blue:((float)(hex & 0xFF))/255.0 alpha:a];
}
+(UIColor *)MABlue {
return [self RGB:(0x12AFE8) A:1.0];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment