OS Development-the use of Uicolor. In iOS development, you often encounter actions related to Uicolor. Like this, Self.backgroundcolor .=[Uicolorredcolor]; Here the Redcolor is a uicolor-defined color. can be used directly. The same, there are several. Uicolor blackcoloruicolor darkgraycoloruicolor lightgraycoloruicolor whitecoloruicolor grayColorUIColor Redcoloruicolor greencoloruicolor bluecoloruicolor cyancoloruicolor yellowcoloruicolor magentaColorUIColor Orangecoloruicolor Purplecoloruicolor Browncoloruicolor Clearcoloruicolor lighttextcoloruicolor Darktextcoloruicolor Grouptableviewbackgroundcoloruicolor Viewflipsidebackgroundcoloruicolor Scrollviewtexturedbackgroundcoloruicolor Underpagebackgroundcolor But sometimes, these kinds of things don't meet our needs. We need to customize what we need with RGB colors. This is the time to use the following method. Self.backgroundcolor= [Uicolor colorwithred:226.0/255.0Green231.0/255.0blue:237.0/255.0Alpha1.0]; Here we introduce the RGB color first. RGB color mode is a color standard of industry, is through the red (R), Green (G), Blue (B) three color channels and their superposition to get a variety of colors, RGB is the red, green, blue three channels of color, This standard almost includes all the colors that human vision can perceive, and is one of the most widely used color systems. When we query the RGB color, we get this code. Shape: #F6F6F6 #F6F6F6 actually corresponds to hexadecimal. Each two bits represents a color channel. #F6 (R) |f6| (G) f6| (B) and F6 hexadecimal to 10 is 246. So if you want to set #F6F6F6 this color. The above code should be changed to Self.backgroundcolor= [Uicolor colorwithred:246.0/255.0Green246.0/255.0Blue246.0/255.0Alpha1.0]; simple. Just check the table to find the corresponding RGB code, you can use any one of your favorite colors.
Go Use of Uicolor