Open ctrager opened 4 years ago
Those values are how to calculate color luminance. You multiply them against the R, G, and B values respectively as shown in the formula for pixelDiff
.
Here is some more info about that: https://stackoverflow.com/questions/596216/formula-to-determine-perceived-brightness-of-rgb-color
Why this line? var pixelDiff = rgba[i] 0.3 + rgba[i + 1] 0.6 + rgba[i + 2] * 0.1;
Where did the 0.3, 0.6, 0.1 come from?