Last active
November 15, 2019 16:09
-
-
Save oneandonlyoddo/08b5779c9056cb355d48a9dec483136e to your computer and use it in GitHub Desktop.
luminance of a pixel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
"The colors are not evenly interpreted by our eyes." | |
source: https://cs.stackexchange.com/questions/11876/how-do-i-compute-the-luminance-of-a-pixel | |
*/ | |
float luminance(float r, float g, float b){ | |
return (r * 0.3) + (g * 0.59) + (b * 0.11); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment