• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Brightness
2
3The Brightness module provides an API for setting the screen brightness.
4
5> **NOTE**<br>
6> The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
7
8## Modules to Import
9
10```js
11import brightness from '@ohos.brightness';
12```
13
14## brightness.setValue
15
16setValue(value: number): void
17
18Sets the screen brightness.
19
20This is a system API and cannot be called by third-party applications.
21
22**System capability:** SystemCapability.PowerManager.DisplayPowerManager
23
24**Parameters**
25
26| Name  | Type    | Mandatory  | Description         |
27| ----- | ------ | ---- | ----------- |
28| value | number | Yes   | Brightness value, ranging from **0** to **255**.|
29
30**Example**
31
32```js
33brightness.setValue(128);
34```
35