(Conversion) Use of UIColor, use of uicolor
OS development-Use of UIColor. During ios development, operations related to UIColor are often encountered. For example, self. backgroundColor = [UIColorredColor]; The redColor here is the color defined by UIColor. It can be used directly. There are several similar types. UIColor blackColorUIColor when using whiteColorUIColor grayColorUIColor redColorUIColor greenColorUIColor blueColorUIColor cyanColorUIColor yellowColorUIColor when using purpleColorUIColor brownColorUIColor clearColorUIColor lightTextColorUIColor when using seconds CrollViewTexturedBackgroundColorUIColor underPageBackgroundColor sometimes cannot meet our needs. We need to use RGB color to customize what we need. At this time, we need to use the following method. Self. backgroundColor = [UIColor colorWithRed: 226.0/255.0 green: 231.0/255.0 blue: 237.0/255.0 alpha: 1.0]; here we will first introduce the RGB color. The RGB color mode is a color standard in the industry) the changes of the three color channels and their overlapping to obtain a variety of colors, RGB represents the colors of the red, green, and blue channels, this standard covers almost all colors that human vision can perceive and is one of the most widely used color systems. This code is obtained when we query the RGB color. For example, # F6F6F6 # F6F6F6 actually corresponds to hexadecimal. Each two represents a color channel. # F6 (R) | F6 | (G) F6 | (B) and F6 hexadecimal to 10: 246. Therefore, if you want to set it to # F6F6F6. The above code should be changed to self. backgroundColor = [UIColor colorWithRed: 246.0/255.0 green: 246.0/255.0 blue: 246.0/255.0 alpha: 1.0]; that's easy. You only need to look up the corresponding RGB code to use any color you like.