Color Lightness Formula
In Wrap we are using the following formula for getting lightness from RGB channels:
Y = 0.2126 * R + 0.7152 * G + 0.0722 * B
It’s using in HDTV and known as Rec.709. This implementation is closest to the percieved lightness.