Skip to content

Instantly share code, notes, and snippets.

@oneandonlyoddo
Last active November 15, 2019 16:09
Show Gist options
  • Save oneandonlyoddo/08b5779c9056cb355d48a9dec483136e to your computer and use it in GitHub Desktop.
Save oneandonlyoddo/08b5779c9056cb355d48a9dec483136e to your computer and use it in GitHub Desktop.
luminance of a pixel
/*
"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