) Use of UIColor, use of uicolor

Source: Internet
Author: User

(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.

 

 

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.