AmbientLightSensor Class
The ambient light sensor (https://w3c.github.io/ambient-light/#ambient-light-sensor-interface): the illuminance around the device, in lux, rounded to 50 lux (the changes of less than 25 lux are discarded). It reads the DeviceSensorType.AmbientLight sensor of the device, and needs the ambient-light-sensor permission and permissions policy feature.
public sealed class AmbientLightSensor : Sensor- Inheritance
SensorAmbientLightSensor
Constructors
| Name | Description |
|---|---|
| AmbientLightSensor(SensorOptions?) | Creates an ambient light sensor. Throws a SecurityError DomException when the document is not allowed to use the ambient-light-sensor feature. |
AmbientLightSensor(SensorOptions?)
MotionSensors.csCreates an ambient light sensor. Throws a SecurityError DomException when the document is not allowed to use the ambient-light-sensor feature.
public AmbientLightSensor(SensorOptions? sensorOptions = null)Properties
| Name | Description |
|---|---|
| Illuminance | Gets the illuminance, in lux, or null. |