I have a function which receives a UIColor and needs to use it’s RGBA values.
What I did so far was to use CGColorGetComponents but that doesn’t work well for other colorspaces (for example [UIColor blackColor] which is in grayscale).
Using getRed green blue (in iOS 5) also doesn’t work on [UIColor blackColor] (returns false).
Any easy way of doing this?
The following method should work in most cases (except pattern-colors). Add it as a category to UIColor.