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
Sensor AmbientLightSensor

Constructors

NameDescription
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.cs

Creates 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

NameDescription
IlluminanceGets the illuminance, in lux, or null.

Illuminance

MotionSensors.cs

Gets the illuminance, in lux, or null.

public double? Illuminance { get; }