added getLuminance function

This needs to be slimmed down in the future, but for now we can get the
luminance.