From db27879ff737153dd6031808b243a53ee70d6dbc Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 10 Nov 2016 22:01:00 +0100 Subject: [PATCH] Fix calculation of color luminance. --- renderdocui/Code/Helpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderdocui/Code/Helpers.cs b/renderdocui/Code/Helpers.cs index 10f68604e..602b3e3c1 100644 --- a/renderdocui/Code/Helpers.cs +++ b/renderdocui/Code/Helpers.cs @@ -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)