Is there an easy way to convert UIColor to a hexadecimal value ? Or do we have to get the RGB components with CGColorGetComponents and then work it
UIColor
CGColorGetComponents
There isn't, as far as I know, any built in solution. Note however, that you should multiply by 255 instead of 256.
255
256
Getting an hexadecimal representation is an easy task, so you won't have many troubles to build the string manually.
NSLog(@"%X%X%X", redInteger, greenInteger, blueInteger);