Duilib Study Notes 3-color Exploration

Source: Internet
Author: User

XML can be used in the first two logs. Today, I am ready to make a good effort, but the result is stuck in the color.

At first, I set the color to 0 0000ff in PS.

Here 01 is R, 04 is g, FF is B

Bkcolor = "# 00000ff" is a property of the control ". The code is black, not the blue we expected.

It was discovered that the color in duilib is 8 bits, and the color in PS is 6 bits. The other two values are a, which indicates transparency. The color expression order in duilib is:

Argb

Transparency | red | green | blue

As you know, adding a blue color to the red color will change to pink, so I will use the blue background here. If the transparent color takes effect, the red control will become pink if translucent. The RGB code of pure red is # ff0000, and FF is the maximum value, so the opaque argb code is # FF 00

The XML Code is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Window mininfo = "400,360" size = "480,320"> <font name = "" size = "16" default = "true"/> <verticallayout bkcolor = "# ff00000ff"> <button name = "closebutton" Height = "20" bkcolor = "#88ff0000" text = "this is transparent" maxwidth = "120"/> <button name = "closebutton" height = "20" bkcolor = "# ffff0000" text = "this is not transparent" maxwidth = "120"/> </verticallayout> </WINDOW>

The effect after running is as follows:

I don't want to change the image and text. I also changed the strong color code as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Window mininfo = "400,360" size = "480,320"> <font name = "" size = "16" default = "true"/> <verticallayout bkcolor = "# ffab7958"> <button name = "closebutton" Height = "20" bkcolor = "#88e47621" text = "this is transparent" maxwidth = "120"/> <button name = "closebutton" height = "20" bkcolor = "# ffe47621" text = "this is not transparent" maxwidth = "120"/> </verticallayout> </WINDOW>

The running effect is as follows:

In addition, I also wrote a code with obvious effects. The effects are as follows:

Finally, we need to add that this transparency is useless for the main window, but the first two colors must be filled when writing the color. Otherwise, the parsing color will be incorrect.

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.