ColorSense-for-Xcode icon indicating copy to clipboard operation
ColorSense-for-Xcode copied to clipboard

RGB with hexadecimal color

Open Beyond-Chao opened this issue 8 years ago • 0 comments

Not Work RGB with hexadecimal color ;

example:[UIColor colorWithRGBHex:0xF5F6F7];

  • (UIColor*) colorWithRGBHex: (UInt32) hex { int r = (hex >> 16) & 0xFF; int g = (hex >> 8) & 0xFF; int b = (hex) & 0xFF; return [UIColor colorWithRed: r / 255.0f green: g / 255.0f blue: b / 255.0f alpha: 1.0f]; }

Beyond-Chao avatar May 11 '16 07:05 Beyond-Chao