How to get all colors availables in objective c?

197 Views Asked by At

I want know if is possible get all colors named available in objective c. With fonts we can get the family names in an array and then in a loop get all fonts of each family font.

Is possible get the colors: gray, red, blue.. like fonts?

We can get all font like:

NSArray *fontFamilies = [UIFont familyNames];
1

There are 1 best solutions below

0
On BEST ANSWER

Colors are different. iOS is not limited to a predefined set of colors, it supports the whole RGB spectrum.

There are some color constants defined on UIColor, for convenience. You can find them in the documentation: https://developer.apple.com/reference/uikit/uicolor?language=objc#symbols

However, you can always create more constants. This is very different from fonts which have to be actually added to the OS or you app using resources.