Java 色值转化成 Color

 /**
     * 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;
    }

你可能感兴趣的:(Java 色值转化成 Color)