定义颜色时什么是0x30?

She*_*lam 2 java rgb android hex colors

我在网上看到了一个例子:

private int[] colors = new int[] { 0x30F8F8F8, 0x30EAEAEA };
Run Code Online (Sandbox Code Playgroud)

我不确定第一个字符代表什么,但最后6个看起来像十六进制数字.它是否正确?

cor*_*iKa 6

根据格式,看起来这些颜色是RGBA(或其他一些重新定位).

实质上,

0x30 = Alpha component
0xF8 = Red component
0xF8 = Green component
0xF8 = Blue component
Run Code Online (Sandbox Code Playgroud)

如果你知道哪一个是alpha,你可以用00替换它,或者如果它在开头就删除它

0xF8F8F8
0x00F8F8F8
Run Code Online (Sandbox Code Playgroud)