Reputation: 1336
I have an array of UIColors like
[UIColor blueColor];
is it possible to get the name "blue" from that UIColor, to display it in a string?
Upvotes: 1
Views: 1924
Reputation: 1674
A list of color names can be obtained using runtime
.
See my question: How to get all Color methods of UIColor?
You can also use string methods to convert 'xxxColor'
to 'xxx'
if needed.
Upvotes: 0
Reputation: 5343
You can get RGB and Alpha of the UIColor, if you want.
Upvotes: 0
Reputation: 17861
There's nothing built in to UIKit, but Erica Sadun's uicolor-utilities library adds similar functionality.
Upvotes: 2