Android Utililty Methods Color Parse

List of utility methods to do Color Parse

Description

The list of methods to do Color Parse are organized into topic(s).

Method

intparseColor(String inColor)
parse Color
int reColor = 0;
try {
    if (inColor != null && inColor.length() != 0) {
        inColor = inColor.replace(" ", "");
        if (inColor.charAt(0) == 'r') { 
            int start = inColor.indexOf('(') + 1;
            int off = inColor.indexOf(')');
            inColor = inColor.substring(start, off);
...
intparseColor(String colorName)
parse Color
return Color.parseColor(colorName.toLowerCase());
IntegerparseHexColor(String colorStr)
parse Hex Color
Integer color = null;
try {
    color = new Integer((int) Long.parseLong(colorStr, 16));
} catch (NumberFormatException e) {
return color;
inttoARGB(String colorString)
to ARGB
return android.graphics.Color.parseColor(colorString);
inttoARGB(int alpha, int red, int green, int blue)
to ARGB
return android.graphics.Color.argb(alpha, red, green, blue);