UIColor UIColor, :
UIColor + Extras.h
#import <UIKit/UIKit.h>
@interface UIColor(Extras)
+ (UIColor *)colorWithRGBA:(NSUInteger) rgba;
+ (UIColor *)colorWithRGB:(NSUInteger) rgb;
@end
UIColor + Extras.m
#import "UIColor+Extras.h"
@implementation UIColor(Extras)
+ (UIColor *)colorWithRGBA:(NSUInteger) rgba
{
return [UIColor colorWithRed:(rgba >> 24) / 255.0f green:(0xff & ( rgba >> 16)) / 255.0f blue:(0xff & ( rgba >> 8)) / 255.0f alpha:(0xff & rgba) / 255.0f];
}
+ (UIColor *)colorWithRGB:(NSUInteger) rgb
{
return [UIColor colorWithRed:(rgb >> 16) / 255.0f green:(0xff & ( rgb >> 8)) / 255.0f blue:(0xff & rgb) / 255.0f alpha:1.0];
}
@end
, [UIColor colorWithRGBA:0xFF00FFFF] [UIColor colorWithRGB:0xFF00FF]
, , UIButton.h, , UIColor, [UIColor lightTextColor] [UIColor darkTextColor] .. UIColor.
http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIColor_Class/Reference/Reference.html
, :
[[button titleLabel] textColor]
. , . .