Update toGray.js

using a weighting equation to perform RGBA -> Gray equation, not simply averaging.