Java 色值转化成 Color
2017-05-11 本文已影响0人
jasonlu1208
/**
* RGB 转 Color
*
*
* @param c
* @return
*/
private static Color parseToColor(final String c) {
Color convertedColor = Color.ORANGE;
try {
convertedColor = new Color(Integer.parseInt(c, 16));
} catch(NumberFormatException e) {
// codes to deal with this exception
}
return convertedColor;
}