Added getBrightness function