Java examples for 2D Graphics:Color String
Color to Hex String
//package com.java2s; import java.awt.Color; public class Main { public static String toHexString(final Color color) { final int rgb = color.getRGB(); final String hex = String.format("#%06X", (0xFFFFFF & rgb)); return hex; }// ww w . j av a2s . c o m }