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;
    }
上一篇下一篇

猜你喜欢

热点阅读