-
-
Save codeswimmer/3375904 to your computer and use it in GitHub Desktop.
Display hex code for a UIColor
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
CGFloat red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; | |
[someColor getRed:&red green:&green blue:&blue alpha:&alpha]; | |
[someLabel setText:[NSString stringWithFormat:@"#%02X%02X%02X", (int) red * 255.0f, (int) green * 255.0f, (int) blue * 255.0f]]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment