I would like to know is it possible to get current hex code color from an UIView programmatically.
I know we can get it easily on Storyboard. But how to do this programmatically.
I would like to know is it possible to get current hex code color from an UIView programmatically.
I know we can get it easily on Storyboard. But how to do this programmatically.
Hope this helps:
CGFloat red = self.view.backgroundColor.CIColor.red;
CGFloat blue = self.view.backgroundColor.CIColor.blue;
CGFloat green = self.view.backgroundColor.CIColor.green;
CGFloat alpha = self.view.backgroundColor.CIColor.alpha;
In return you got RGB.