Go Use of Uicolor

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.