UIColor를 RGB로 입력하기

-- iOS (iPhone) 2012. 12. 6. 14:45
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \

green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \

blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]


#define UIColorFromRGBWithAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \

green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \

blue:((float)(rgbValue & 0xFF))/255.0 alpha:a]



labelName.textColor = UIColorFromRGB(0xf4f4f4);

labelName.backgroundColor = UIColorFromRGBWithAlpha(0xf4f4f4, 1.0);

posted by 어린왕자악꿍