public class LightBrightness extends Object
The brightness values of the following three color channels are available for lights: red, green, and blue.
SystemCapability.Sensors#MISC_DEVICE| 构造器 | 说明 |
|---|---|
LightBrightness(int redBrightness,
int greenBrightness,
int blueBrightness) |
A constructor used to create a
LightBrightness instance with input parameters
redBrightness, greenBrightness, and blueBrightness specified. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
int |
getBlueBrightness() |
Obtains the brightness value of the blue channel when the light blinks.
|
int |
getGreenBrightness() |
Obtains the brightness value of the green channel when the light blinks.
|
int |
getRedBrightness() |
Obtains the brightness value of the red channel when the light blinks.
|
void |
setBlueBrightness(int blueBrightness) |
Sets the brightness value for the blue channel of the light.
|
void |
setGreenBrightness(int greenBrightness) |
Sets the brightness value for the green channel of the light.
|
void |
setRedBrightness(int redBrightness) |
Sets the brightness value for the red channel of the light.
|
public LightBrightness(int redBrightness,
int greenBrightness,
int blueBrightness)
LightBrightness instance with input parameters
redBrightness, greenBrightness, and blueBrightness specified.redBrightness - Indicates the brightness value for the red channel of the light. The
value range is 0–255.greenBrightness - Indicates the brightness value for the green channel of the light.
The value range is 0–255.blueBrightness - Indicates the brightness value for the blue channel of the light.
The value range is 0–255.public int getRedBrightness()
public void setRedBrightness(int redBrightness)
redBrightness - Indicates the brightness value for the red channel of the light. The
value range is 0–255. The color brightness is determined by the light itself.public int getGreenBrightness()
public void setGreenBrightness(int greenBrightness)
greenBrightness - Indicates the brightness value for the green channel of the light.
The value range is 0–255. The color brightness is determined by the light itself.public int getBlueBrightness()
public void setBlueBrightness(int blueBrightness)
blueBrightness - Indicates the brightness value for the blue channel of the light.
The value range is 0–255. The color brightness is determined by the light itself.