コード例 #1
0
    public static string PowerString_GrayScale(this Color c)
    {
        float ratio = 100f / 256f;

        int grayscale = (c.R + c.G + c.B) / 3;

        //Normalize grayscale to get a power
        int power = 100 - (int)(grayscale * ratio);

        return(ColorCode.GetPowerString(power));
    }