Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70746

Brightness plugin not setting full brightness

$
0
0

@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

Read full topic


Viewing all articles
Browse latest Browse all 70746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>