Instead of using all channels of the colour to approximate brightness, this function was sublty ignoring the blue channel and over-stating other channels.