blob: 4835ede621eebeb176d88adc03a538d3f4675d20 [file] [log] [blame]
#import "UIColor+GTXAdditions.h"
@implementation UIColor (GTXAdditions)
- (NSString *)gtx_description {
CGFloat redValue, greenValue, blueValue;
[self getRed:&redValue green:&greenValue blue:&blueValue alpha:NULL];
// Get the RGB values in [0, 255] range as well.
NSInteger red = (NSInteger)(redValue * 255.0);
NSInteger green = (NSInteger)(greenValue * 255.0);
NSInteger blue = (NSInteger)(blueValue * 255.0);
return
[NSString stringWithFormat:@"RGB #%02X%02X%02X (%f, %f, %f)", (int)red, (int)green, (int)blue,
(float)redValue, (float)greenValue, (float)blueValue];
}
@end