颜色的10进制转换16进制
使用java将颜色10进制转换16进制
Color color = new Color(userFontColor); //10进制的数字颜色
String red = (String.valueOf(Integer.toHexString(color.getRed())).length()>1 ? "":"0") + Integer.toHexString(color.getRed());
String green = (String.valueOf(Integer.toHexString(color.getGreen())).length()>1 ? "":"0") + Integer.toHexString(color.getGreen());
String blue = (String.valueOf(Integer.toHexString(color.getBlue())).length()>1 ? "":"0") + Integer.toHexString(color.getBlue());