Getting started with the Ambient Light Sensor

Dean Hume’s been doing a lot great work with PWA’s recently, and he’s also been exploring a lot of the new platform API’s, in this case the Generic Sensor API:
The Ambient Light Sensor API provides developers with the means to determine ambient light levels as detected by the device’s main light detector. This information is available to developers in terms of lux units. If you are building a Progressive Web App and you want to style it differently depending on the light levels in the room, then this could be the feature for you.


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan

<p>Dean Hume's been doing a lot great work with PWA's recently, and he's also been exploring a lot of the new platform API's, in this case the Generic Sensor API:</p> <blockquote> <p>The Ambient Light Sensor API provides developers with the means to determine ambient light levels as detected by the device’s main light detector. This information is available to developers in terms of lux units. If you are building a Progressive Web App and you want to style it differently depending on the light levels in the room, then this could be the feature for you. There are a number of use cases for this feature, such as a web application that provides input for a smart home system to control lighting, a "Kindle" style reading app, or even a web app that calculates settings for a camera with manual controls (aperture, shutter speed, ISO, etc.).</p> </blockquote> <p><a href="https://deanhume.com/ambient-light-sensor/">Read full post</a>.</p> <p>I spoke about the Generic Sensor API at Chrome Dev Summit 2016, so it's certainly taken a while for it to land in Chrome (I think it is still behind a flag) and it looks like it has landed in Edge first. The Ambient light sensor is one of many API's that is built on top of Generic Sensors — there are more such as gyro and magnetometers — and it allows you to get information about the ambient light levels around the user opening up use-cases such as automatic adjustment of brightness or even offering the user to switch to a dark-mode theme. It's certainly going to be interesting to see what the base Generic Sensor API will bring to web experiences.</p>


This content originally appeared on Modern Web Development with Chrome and was authored by Paul Kinlan


Print Share Comment Cite Upload Translate Updates
APA

Paul Kinlan | Sciencx (2018-07-13T11:55:01+00:00) Getting started with the Ambient Light Sensor. Retrieved from https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/

MLA
" » Getting started with the Ambient Light Sensor." Paul Kinlan | Sciencx - Friday July 13, 2018, https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/
HARVARD
Paul Kinlan | Sciencx Friday July 13, 2018 » Getting started with the Ambient Light Sensor., viewed ,<https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/>
VANCOUVER
Paul Kinlan | Sciencx - » Getting started with the Ambient Light Sensor. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/
CHICAGO
" » Getting started with the Ambient Light Sensor." Paul Kinlan | Sciencx - Accessed . https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/
IEEE
" » Getting started with the Ambient Light Sensor." Paul Kinlan | Sciencx [Online]. Available: https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/. [Accessed: ]
rf:citation
» Getting started with the Ambient Light Sensor | Paul Kinlan | Sciencx | https://www.scien.cx/2018/07/13/getting-started-with-the-ambient-light-sensor/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.