问题描述
- 定义颜色时,0x30是什么意思?
- 我在网上看到这样的代码:
private int[] colors = new int[] { 0x30F8F8F8 0x30EAEAEA };
我不确定前两个字母是什么意思,但是后面6个字符看起来是16进制数字。是这样的吗?
解决方案
根据格式,看起来这些颜色在 RGBA 中。
实际上,
0x30 = Alpha component0xF8 = Red component0xF8 = Green component0xF8 = Blue component
如果你知道哪个是 alpha,你可以用00 替换,或者在开始,就删掉。
0xF8F8F8
解决方案二:
透明度 alpha 0X 十六进制
上行的答案居然不够字符,表达式顺序是“aabbggrr”,其中aa=alpha(00 到 ff);bb=blue(00 到 ff);gg=green(00 到 ff);rr=red(00 到 ff)
时间: 2024-09-17 03:34:37