Here you can find the source of colourToString(Color colour)
public static String colourToString(Color colour)
//package com.java2s; import java.awt.Color; public class Main { public static String colourToString(Color colour) { if (colour == null) { return "extend"; } else if (colour.getAlpha() == 0) { return "transparent"; }/*from w w w . ja v a 2 s.c o m*/ return String.format("#%08X", colour.getRGB()); } }