Brightness control function.