Table of Contents

Class AmbientLightSensor

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll
NOTE
Experimental
The AmbientLightSensor interface of the Sensor APIs returns the current light level or illuminance of the ambient light around the hosting device.
[Value("AmbientLightSensor")]
public class AmbientLightSensor : Sensor
Inheritance
AmbientLightSensor
Inherited Members

Remarks

To use this sensor, the user must grant permission to the 'ambient-light-sensor' device sensor through the Permissions API.

This feature may be blocked by a Permissions Policy set on your server.

See also on MDN

Constructors

AmbientLightSensor()

public AmbientLightSensor()

AmbientLightSensor(SensorOptions)

NOTE
Experimental
The AmbientLightSensor() constructor creates a new AmbientLightSensor object, which returns the current light level or illuminance of the ambient light around the hosting device.
public AmbientLightSensor(SensorOptions sensorOptions = null)

Parameters

sensorOptions SensorOptions

Remarks

-'sensor.Reading' event

See also on MDN

Properties

Illuminance

NOTE
Experimental
The illuminance read-only property of the AmbientLightSensor interface returns the current light level in lux of the ambient light level around the hosting device.
[Value("illuminance")]
public Number? Illuminance { get; }

Property Value

Number

A 'Number' indicating the current light level in lux.

Remarks