ios - IB Color Issues -


i noticed when setting uiview background in xcode 6, colors different. setting 1st view hex of #414042 in interface builder. , second view 0x414042 in code following hex rgb macro.

#define rgb(hexvalue)                   [uicolor colorwithred:((float)((hexvalue & 0xff0000) >> 16))/255.0 green:((float)((hexvalue & 0xff00) >> 8))/255.0 blue:((float)(hexvalue & 0xff))/255.0 alpha:1.0] 

and can see there difference.

enter image description here

in ib there gear setting change rgb type, after changing , trying set rgb, resets srgb.

enter image description here

anyone know way around hex colors in code match hex color in ib?

is ios version 10+ ? see apple document, apple changed default color space, if want xib using same color code,on xib ,you need choose device rgbor srgb , different generic rgb


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -