public class ColorUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static float |
ACTIVE_OPACITY_FACTOR_EDGE |
static float |
ACTIVE_OPACITY_FACTOR_FILL |
static int |
DISABLED_ALPHA_EDGE |
static int |
DISABLED_ALPHA_FILL |
| Constructor and Description |
|---|
ColorUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
decreaseRgbChannels(Context context,
int res,
float percent)
Darkens a color by reducing its RGB channel values.
|
static int |
increaseOpacity(Context context,
int res,
int alpha)
Lightens a color by increasing its alpha channel value
|
static int |
resolveColor(int color,
Context context)
Resolves a color resource.
|
public static final int DISABLED_ALPHA_FILL
public static final int DISABLED_ALPHA_EDGE
public static final float ACTIVE_OPACITY_FACTOR_FILL
public static final float ACTIVE_OPACITY_FACTOR_EDGE
public static int resolveColor(@ColorRes
int color,
Context context)
color - the color resourcecontext - the current contextpublic static int decreaseRgbChannels(Context context,
@ColorRes
int res,
float percent)
context - the current contextres - the color resourcepercent - the percent to decreasepublic static int increaseOpacity(Context context,
@ColorRes
int res,
int alpha)
context - the current contextres - the color resourcealpha - the alpha to set