Here you can find the source of toHTMLColor(Color c)
public static String toHTMLColor(Color c)
//package com.java2s; import java.awt.Color; public class Main { public static String toHTMLColor(Color c) { return "#" + Integer.toHexString(c.getRGB()).substring(2); }// w w w . j a v a 2s . co m }