Skip to content

Instantly share code, notes, and snippets.

@jlcampana
Created August 21, 2012 10:42
Show Gist options
  • Save jlcampana/3414420 to your computer and use it in GitHub Desktop.
Save jlcampana/3414420 to your computer and use it in GitHub Desktop.
UIColor+IntegerRGB.m
//
// UIColor+IntegerRGB.m
// Shell mPayment
//
// Created by Jose Luis Campaña on 8/21/12.
//
//
#import "UIColor+IntegerRGB.h"
@implementation UIColor (IntegerRGB)
+(UIColor *)colorIntegerWithRed:(NSInteger)red green:(NSInteger)green blue:(NSInteger)blue alpha:(CGFloat)alpha
{
return [UIColor colorWithRed:(CGFloat)red/255.0f green:(CGFloat)green/255.0f blue:(CGFloat)blue/255.0f alpha:alpha];
}
@end
//
// UIColor+IntegerRGB.m
// Shell mPayment
//
// Created by Jose Luis Campaña on 8/21/12.
//
//
#import "UIColor+IntegerRGB.h"
@implementation UIColor (IntegerRGB)
+(UIColor *)colorIntegerWithRed:(NSInteger)red green:(NSInteger)green blue:(NSInteger)blue alpha:(CGFloat)alpha
{
return [UIColor colorWithRed:(CGFloat)red/255.0f green:(CGFloat)green/255.0f blue:(CGFloat)blue/255.0f alpha:alpha];
}
+(UIColor *)colorWithImageNamed:(NSString *)image
{
return [UIColor colorWithPatternImage:[UIImage imageNamed:image]];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment