public class ColorUtils
extends java.lang.Object
| 构造器和说明 |
|---|
ColorUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static android.content.res.ColorStateList |
createColorStateList(int normal,
int pressed) |
static android.content.res.ColorStateList |
createColorStateList(int normal,
int pressed,
int disabled) |
static android.content.res.ColorStateList |
createColorStateList(int normal,
int pressed,
int selected,
int disabled) |
static int |
getColor(int startColor,
int endColor,
float offset)
取过渡色
|
static boolean |
isColorDark(int color)
判断颜色是否深色
|
static java.lang.String |
toHexColor(int color)
Color转换为颜色字符串,格式:#ffffffff
|
public static int getColor(int startColor,
int endColor,
float offset)
offset - 取值范围:0 ~ 1public static android.content.res.ColorStateList createColorStateList(int normal,
int pressed)
normal - 正常时的颜色pressed - 按压时的颜色public static android.content.res.ColorStateList createColorStateList(int normal,
int pressed,
int disabled)
normal - 正常时的颜色pressed - 按压时的颜色disabled - 不可用时的颜色public static android.content.res.ColorStateList createColorStateList(int normal,
int pressed,
int selected,
int disabled)
normal - 正常时的颜色pressed - 按压时的颜色selected - 选中时的颜色disabled - 不可用时的颜色public static java.lang.String toHexColor(int color)
public static boolean isColorDark(int color)