【CSS】Hex(16進数)形式のカラーコードで透明度(アルファ)を指定する
RGBAではなくHex形式のカラーコードで透明度を設定する際、百分率(%)から16進数のalpha-value
を毎回計算するのが非常に手間だったので表としてまとめておく。
%と16進数の対応表
% | 16進数 |
---|---|
100% | ff |
99% | fc |
98% | fa |
97% | f7 |
96% | f5 |
95% | f2 |
94% | f0 |
93% | ed |
92% | eb |
91% | e8 |
90% | e6 |
89% | e3 |
88% | e0 |
87% | de |
86% | db |
85% | d9 |
84% | d6 |
83% | d4 |
82% | d1 |
81% | cf |
80% | cc |
79% | c9 |
78% | c7 |
77% | c4 |
76% | c2 |
75% | bf |
74% | bd |
73% | ba |
72% | b8 |
71% | b5 |
70% | b3 |
69% | b0 |
68% | ad |
67% | ab |
66% | a8 |
65% | a6 |
64% | a3 |
63% | a1 |
62% | 9e |
61% | 9c |
60% | 99 |
59% | 96 |
58% | 94 |
57% | 91 |
56% | 8f |
55% | 8c |
54% | 8a |
53% | 87 |
52% | 85 |
51% | 82 |
50% | 80 |
49% | 7d |
48% | 7a |
47% | 78 |
46% | 75 |
45% | 73 |
44% | 70 |
43% | 6e |
42% | 6b |
41% | 69 |
40% | 66 |
39% | 63 |
38% | 61 |
37% | 5e |
36% | 5c |
35% | 59 |
34% | 57 |
33% | 54 |
32% | 52 |
31% | 4f |
30% | 4d |
29% | 4a |
28% | 47 |
27% | 45 |
26% | 42 |
25% | 40 |
24% | 3d |
23% | 3b |
22% | 38 |
21% | 36 |
20% | 33 |
19% | 30 |
18% | 2e |
17% | 2b |
16% | 29 |
15% | 26 |
14% | 24 |
13% | 21 |
12% | 1f |
11% | 1c |
10% | 1a |
9% | 17 |
8% | 14 |
7% | 12 |
6% | 0f |
5% | 0d |
4% | 0a |
3% | 08 |
2% | 05 |
1% | 03 |
0% | 00 |