Java examples for 2D Graphics:Color String
color To String
//package com.java2s; public class Main { public static void main(String[] argv) throws Exception { int c = 2; System.out.println(colorToString(c)); }/* w ww. ja v a 2s . co m*/ public static final String colorToString(int c) { return ("rgba=(" + ((c >> 16) & 0xff) + "," + ((c >> 8) & 0xff) + "," + (c & 0xff) + "," + ((c >> 24) & 0xff) + ")"); } }