Created
January 16, 2014 13:59
-
-
Save oxUnd/8455441 to your computer and use it in GitHub Desktop.
rgb to hex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *) rgbToHex: (NSColor*) color { | |
NSString *hexColor = [NSString stringWithFormat:@"#%02X%02X%02X", | |
(int) ([color redComponent] * 0xFF), | |
(int) ([color greenComponent] * 0xFF), | |
(int) ([color blueComponent] * 0xFF) | |
]; | |
return hexColor; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment