Android calculates the transparency of the layout background

Source: Internet
Author: User

1, #ff000000 This is 16 color code, the first 2 FF is transparent, the last 6 bits are color values (000000 is black, FFFFFF is white, can be obtained by software such as PS).

2, the transparency is divided into 256 order (0-255), the computer uses the 16 notation as (00-FF).

      Transparent is 0 order, opaque is 255 order, if 50% transparent is 127 order (256 of course is 128, but because it is starting from 0, so it is actually 127).

3, 10 255 conversion into 16 binary is ff,127 converted into 16 binary is 7f, #7f000000 represents 50% transparency of the black.

(written #50000000 of course not) the binary conversion can be used with the Win7 to bring the calculator (to scientific type). Example: 25% a red "#3ff70000 of transparency

---------》

4. RELATED LINKS http://jingyan.baidu.com/article/37bce2be134bcf1002f3a2a5.html

Android calculates the transparency of the layout background

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.