Here you can find the source of toHex0x(Color col)
private static String toHex0x(Color col)
//package com.java2s; //License from project: Open Source License import java.awt.Color; public class Main { private static String toHex0x(Color col) { return String.format("0x%02x%02x%02x", col.getRed(), col.getGreen(), col.getBlue()); //return "0x"+Integer.toHexString(col.getRGB() & 0xffffff); }/*w w w . j a v a2 s . c o m*/ }