public class ColorUtil extends Object
| 构造器和说明 |
|---|
ColorUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static Color |
argb(Color color,
float opacity)
将现有的color常量加上opacity,构造成argb color
|
static Color |
argb2Color(String argb)
转换为color对象
|
static String |
argbHex(Color color,
float opacity)
转换为字符型
比如Color.ORANGE,0.8f -- 0xCCFFC800
|
static int |
argbString2Int(String argb)
必须是Ox开头
|
static boolean |
hasTransparency(int argb)
判断是否有alpha
|
static String |
opacity2AlphaHex(float opacity)
将浮点的不透明度转换为ragb的16进制值
比如1.0 -- FF
0.95 -- F2
|
public static int argbString2Int(String argb)
argb - string类型的argbpublic static boolean hasTransparency(int argb)
argb - int类型public static String opacity2AlphaHex(float opacity)
opacity - 不透明度public static Color argb(Color color, float opacity)
color - java的Color类opacity - 浮点的不透明度Copyright © 2017. All rights reserved.