Android Utililty Methods Int to Color Convert

List of utility methods to do Int to Color Convert

Description

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

Method

StringGetColorString(int ColorInt)
Get Color String
String colorString = null;
try {
    colorString = String.format("#%06X", 0xFFFFFF & ColorInt);
} catch (Exception e) {
    Log.e(TAG, "An Exception error occurred in GetColorString. ", e);
return colorString;
float[]RGBArray(Resources resources, int colorId)
RGB Array
int color = resources.getColor(colorId);
float red = (color >> 16) & 0xFF;
float green = (color >> 8) & 0xFF;
float blue = (color >> 0) & 0xFF;
float alpha = (color >> 24) & 0xFF;
return new float[] { red / 255f, green / 255f, blue / 255f,
        alpha / 255f };