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.