Fix calculation of color luminance.

This commit is contained in:
baldurk
2016-11-10 22:01:00 +01:00
parent 9e22509521
commit db27879ff7
+1 -1
View File
@@ -114,7 +114,7 @@ namespace renderdocui.Code
public static float GetLuminance(this System.Drawing.Color c)
{
return (float)(0.2126 * Math.Pow(c.R * 255.0, 2.2) + 0.7152 * Math.Pow(c.G * 255.0, 2.2) + 0.0722 * Math.Pow(c.B * 255.0, 2.2));
return (float)(0.2126 * Math.Pow(c.R / 255.0, 2.2) + 0.7152 * Math.Pow(c.G / 255.0, 2.2) + 0.0722 * Math.Pow(c.B / 255.0, 2.2));
}
public static int CharCount(string s, char c)