Your Search Results

    PowerManager.screenBrightness

    « DOM Reference

    Non-standard
    This feature is not on a current W3C standards track, but it is supported on the Firefox OS platform. Although implementations may change in the future and it is not supported widely across browsers, it is suitable for use in code dedicated to Firefox OS apps.

    This API is available on Firefox OS for certified applications only.

    Summary

    The screenBrightness property defines the brightness of the screen's backlight, on a scale from 0 (very dim) to 1 (full brightness).

    Setting this attribute modifies the screen's brightness. Values outside the range [0-1] are not allowed, and an error of type NS_ERROR_INVALID_ARG is thrown if such a value is assigned to that property.

    This attribute can be read and written even when the screen is disabled, but the backlight is off while the screen is disabled.

    If you write a value of X into this attribute, the attribute may not have the same value X when you later read it. Most screens don't support as many different brightness levels as there are doubles between 0 and 1, so the value's precision is reduced before storing it.

    Syntax

    var brightness = navigator.mozPower.screenBrightness

    Value

    Return a number in the range [0-1].

    Specification

    Not part of any specification.

    See also

    Document Tags and Contributors

    Contributors to this page: Sheppy, SarahWalrus, kscarfone, Jeremie
    Last updated by: kscarfone,