Android examples for Graphics:Color RGB Value
Convert int color value to ARGB String #AARRGGBB
//package com.java2s; import android.graphics.Color; public class Main { public static String toARGBString(int color) { // format: #AARRGGBB String alpha = Integer.toHexString(Color.alpha(color)); String red = Integer.toHexString(Color.red(color)); String green = Integer.toHexString(Color.green(color)); String blue = Integer.toHexString(Color.blue(color)); if (alpha.length() == 1) alpha = "0" + alpha; if (red.length() == 1) red = "0" + red; if (green.length() == 1) green = "0" + green; if (blue.length() == 1) blue = "0" + blue; return "#" + alpha + red + green + blue; }/*ww w . ja va2 s. com*/ }