ios - Converting a value within 16-bit color range to a UIColor -


i have value in 1 number range , want convert number in 16 bit color range - 65536 colors. how can use value in 65536 colour range uicolor? have method convert hex value color, how 1 convert unsigned int hex value , accurate?

what best way color value within 65536 color range?

[uicolor colorwithred: (color>>11)/31.0 green: ((color>>5)&0x3f)/63.0 blue: (color&0x1f)/31.0 alpha: 1] 

layout of 16-bit colors (source):

enter image description here


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -