@adibbz wrote:
I’m attempting to use the Brightness plugin(https://ionicframework.com/docs/native/brightness/) and want to toggle between original screen brightness and full brightness. However, setting the brightness to 100% is not working and instead setting brightness to 0.900000 or 90%. Here’s the code:
toggleBrightness() { this.brightness.getBrightness() .then((brightness) => { if(brightness < 1.0) { this.brightness.setBrightness(1.0); /* This is setting to 90% instead of 100% */ } else if (brightness >= 1.0) { this.brightness.setBrightness(this.originalBrightness); } }) .catch(e => { console.log('Error getting brightness', e) }); }
Posts: 1
Participants: 1