1

I probably would use scanf and then & with 0xff, 0xff00, 0xff0000 and shift them to get the 3 values for RGB and then call [UIColor colorWithRed: green: blue: alpha: 1]. Is there a better or easy way to implement it?

The # in front should be optional in the string, and it shouldn't be case sensitive so 3a6ffc should work as well as #3A6FFC.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740

1 Answers1

1

You will have to convert the nsstring to hex values, and then get the R, G and B from the hex The following stackoverflow answer is what you are looking for

How to convert HEX RGB color codes to UIColor?

Community
  • 1
  • 1
Omar Abdelhafith
  • 21,163
  • 5
  • 52
  • 56