DWQA QuestionsCategory: ProgramIs the color value obtained by the uicolor colorwithred: Green: Blue: method different from the color value detected by the color picker?
A restless tree asked 2 weeks ago

For example, use uicolor to create a color (21125251) with an alpha value of 100,
[UIColor colorWithRed:21/255.0 Green:125/255.0 Blue:251/255.0 alpha:1.0]];
Using the screenshot tool to detect the color of the simulator, the result of the color value is: (55144251), how to get the correct color?

3 Answers
Fnoz answered 2 weeks ago

I think there are two possibilities:
01. You use the screenshot tool to change the picture when you cut it;
02. How to get the color is a problem;
It is recommended to use the color picker directly to get the color.

Fnoz replied 2 weeks ago

[self.navigationController.navigationBar setBarTintColor:RGB(0x2d, 0xa8, 0xde)];I usually control the background color of NavigationBar like this.

Zero_24747 answered 2 weeks ago

Is sRGB selected by the color picker

arkulo answered 2 weeks ago

I used to use uicolor to set the original color. I found that the color is inconsistent because 255 is not added (21 / 255125 / 255251 / 255). It is estimated that it is inconsistent with your situation