w3c / ambient-light

Ambient Light Sensor
https://www.w3.org/TR/ambient-light/
Other
26 stars 21 forks source link

Ambient Light Sensors to detect RGB colors #9

Open lknik opened 8 years ago

lknik commented 8 years ago

Modern sensors are capable of detecting not only luminance, but also actual RGB colors (e.g. http://ams.com/eng/Products/Light-Sensors/Color-Sensors-Proximity-Detection/TMD37821).

Might be interesting to evaluate the feasibility of including it to the spec/draft at some point. Note: it appears there are no actual devices currently supporting this.

Also, in case this ships, it should be directly subject to permissions.

tobie commented 8 years ago

Thanks.

As discussed, until this is exposed by underlying platforms and shipped in devices there is little point in looking at it more seriously.

I'll keep this open for now in case someone has more on this topic, else we'll revisit whenthese actually show up in devices.

alexshalamov commented 7 years ago

@anssiko Some Android devices as well as Windows API provide temperature in addition to 'clear channel' info. Temperature can be converted to RGB if needed. Do you think it worth experimenting with implementing support for it? RGB data can be used in e.g., accessibility applications or provided as an input for WB to Image Capture API.

anssiko commented 7 years ago

I'm all in for experimentation. Given good use cases and developer excitement we should consider baking it into a future spec update.

(To clarify, we're talking about measuring color temperature, not infrared radiation.)

anssiko commented 6 years ago

I added this issue to the Level 2 milestone.

reillyeon commented 5 years ago

Discussed in F2F at TPAC 2018. Related feature request to immersive-web/proposals#27. @AdaRoseCannon @kyungtae

anssiko commented 5 years ago

F2F minutes: https://www.w3.org/2018/10/23-dap-minutes.html#x06

rakuco commented 5 years ago

For the record since the immersive-web link above no longer works: the issue above was moved and is now immersive-web/lighting-estimation#1

anssiko commented 5 years ago

https://github.com/immersive-web/lighting-estimation/issues/1 seems to pursue an XR Device API-specific ALS extension that is tied with an XRFrame. The ALS API's proposed RGB feature might still be useful for a webxr-polyfill. Cc @AdaRoseCannon to comment whether that'd be a valid use case.

Another use case described in this issue is RGB data as an input to white balance in conjunction with Image Capture API. Cc @riju who has implemented some Image Capture API enhancements and experimented with OpenCV.js to investigate.

AdaRoseCannon commented 5 years ago

A polyfill would definitely be a valid use case.

anssiko commented 5 years ago

Thank you @AdaRoseCannon. We will loop you in for review when this feature work moves forward to ensure it addresses your polyfill requirements.

rzr commented 5 years ago

Well, I also observed that there is no color sensor in generic sensors spec, so I made a basic implementation of tcs34725 for IoT.js (it runs on node as well)

https://github.com/samsunginternet/color-sensor-js

It's very basic, and schema is just :

{
color: "#RrGgBb" 
}

Merging in Ambient light could makes sense, but in the case of tcs34725 It could be misleading because this sensor is active: it ships a white LED that light the material to observe.