mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
Fix calculation of color luminance.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user