@@ -0,0 +1,1538 @@
+%0D%0Apublic class ColorUtils%0D%0A%7B%0D%0A    private ColorUtils() %7B%7D%0D%0A%0D%0A    /**%0D%0A     * %E8%8E%B7%E5%8F%96%E5%AF%B9%E6%AF%94%E5%BA%A6 %5B1~21%5D%0D%0A     */%0D%0A    public static float contrastRatio(int firstColor,int secondColor)%0D%0A    %7B%0D%0A        float contrastRatio;%0D%0A%0D%0A        float firstLuminance = luminance(firstColor);%0D%0A        float secondLuminance = luminance(secondColor);%0D%0A%0D%0A        if(firstLuminance %3E secondLuminance)%0D%0A        %7B%0D%0A            contrastRatio = (firstLuminance + 0.05f)/(secondLuminance + 0.05f);%0D%0A        %7D%0D%0A        else%0D%0A        %7B%0D%0A            contrastRatio = (secondLuminance + 0.05f)/(firstLuminance + 0.05f);%0D%0A        %7D%0D%0A%0D%0A        return contrastRatio;%0D%0A    %7D%0D%0A%0D%0A    /**%0D%0A     * %E8%8E%B7%E5%8F%96%E7%9B%B8%E5%AF%B9%E4%BA%AE%E5%BA%A6%0D%0A     */%0D%0A    public static float luminance(int color)%0D%0A    %7B%0D%0A        double red = red(color) / 255.0;%0D%0A        red = red %3C 0.03928 ? red / 12.92 : Math.pow((red + 0.055) / 1.055, 2.4);%0D%0A        double green = green(color) / 255.0;%0D%0A        green = green %3C 0.03928 ? green / 12.92 : Math.pow((green + 0.055) / 1.055, 2.4);%0D%0A        double blue = blue(color) / 255.0;%0D%0A        blue = blue %3C 0.03928 ? blue / 12.92 : Math.pow((blue + 0.055) / 1.055, 2.4);%0D%0A        return (float) ((0.2126 * red) + (0.7152 * green) + (0.0722 * blue));%0D%0A    %7D%0D%0A%0D%0A    public static int alpha(int color) %7B%0D%0A        return color %3E%3E%3E 24;%0D%0A    %7D%0D%0A%0D%0A    public static int red(int color) %7B%0D%0A        return (color %3E%3E 16) & 0xFF;%0D%0A    %7D%0D%0A%0D%0A    public static int green(int color) %7B%0D%0A        return (color %3E%3E 8) & 0xFF;%0D%0A    %7D%0D%0A%0D%0A%0D%0A    public static int blue(int color) %7B%0D%0A        return color & 0xFF;%0D%0A    %7D%0D%0A%7D%0D%0A

add colorUtils