Here you can find the source of color(String color)
public static String color(String color)
//package com.java2s; //License from project: Open Source License public class Main { public static String color(String color) { if (color == null) { return "#FF0000"; } else if (color.startsWith("#")) { return color; } else {/*from www . j a va 2s. c o m*/ return "#" + color; } } }