From 146c741e69949a80a715719722e7d7dd2193427e Mon Sep 17 00:00:00 2001 From: aakashapoorv Date: Tue, 29 Oct 2013 20:36:38 +0800 Subject: [PATCH] Implemented public float grayscale Changed greyscale to grayscale and implemented grayscale. Grayscale and luma, both represents brightness in an image. So we are using luma = 0.2126*Red + 0.7152*Green + 0.0722*Blue R. W. G. Hunt, M. R. Pointer 2011, Measuring Colour 4th Edition --- Framework/PressPlay.FFWD/Color.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Framework/PressPlay.FFWD/Color.cs b/Framework/PressPlay.FFWD/Color.cs index 6ed5781d..bd468b40 100644 --- a/Framework/PressPlay.FFWD/Color.cs +++ b/Framework/PressPlay.FFWD/Color.cs @@ -1,4 +1,4 @@ -using System; +using System; namespace PressPlay.FFWD { @@ -57,12 +57,11 @@ public byte A } } - public float greyscale + public float grayscale { get { - // TODO: Implement this - throw new NotImplementedException("Not implemented"); + return (float)((0.2126*r) + (0.7152*g) + (0.0722*b)); } }