Java examples for 2D Graphics:Color HEX
Colour To Hex
//package com.java2s; import java.awt.Color; public class Main { /**/*from w w w. j a v a 2 s.com*/ * * @param c * @return */ public static String ColourToHex(Color c) { String s = "#"; String t = Integer.toHexString(c.getRGB()); return s + t.substring(2); } }