介绍: Android中的颜色值一般格式是:#AARRGGBB。AA就是透明度值
透明值: 透明度 (透明)0 –> 255(不透明) 对应着16进制 (透明)00 –> FF(不透明)
透明值计算: 50%透明度,50%也就是256的一半即128,因为是从0开始算的,所以是 127,转换成16进制就是 7F
透明度 | 进制表示 |
---|---|
100% | 00 |
99% | 03 |
98% | 05 |
97% | 07 |
96% | 0A |
95% | 0D |
94% | 0F |
93% | 12 |
92% | 14 |
91% | 17 |
90% | 1A |
89% | 1C |
88% | 1E |
87% | 21 |
86% | 24 |
85% | 26 |
84% | 29 |
83% | 2B |
82% | 2E |
81% | 30 |
80% | 33 |
79% | 36 |
78% | 38 |
77% | 3B |
76% | 3D |
75% | 40 |
74% | 42 |
73% | 45 |
72% | 47 |
71% | 4A |
70% | 4D |
69% | 4F |
68% | 52 |
67% | 54 |
66% | 57 |
65% | 59 |
64% | 5C |
63% | 5E |
62% | 61 |
61% | 63 |
60% | 66 |
59% | 69 |
58% | 6B |
57% | 6E |
56% | 70 |
55% | 73 |
54% | 75 |
53% | 78 |
52% | 7A |
51% | 7D |
50% | 80 |
49% | 82 |
48% | 85 |
47% | 87 |
46% | 8A |
45% | 8C |
44% | 8F |
43% | 91 |
42% | 94 |
41% | 96 |
40% | 99 |
39% | 9C |
38% | 9E |
37% | A1 |
36% | A3 |
35% | A6 |
34% | A8 |
33% | AB |
32% | AD |
31% | B0 |
30% | B3 |
29% | B5 |
28% | B8 |
27% | BA |
26% | BD |
25% | BF |
24% | C2 |
23% | C4 |
22% | C7 |
21% | C9 |
20% | CC |
19% | CF |
18% | D1 |
17% | D4 |
16% | D6 |
15% | D9 |
14% | DB |
13% | DE |
12% | E0 |
11% | E3 |
10% | E6 |
9% | E8 |
8% | EB |
7% | ED |
6% | F0 |
5% | F2 |
4% | F5 |
3% | F7 |
2% | FA |
1% | FC |
0% | FF |