Light Meter Application

Good Morning,

Has anyone done this?  I’m looking for some tips on how you could check the light level in a room.  I’m not looking for rocket science and I’m not looking for super accuracy.  I thought you might be able to do it by taking a snap shot with the camera and somehow checking the average color… or something like that.

Anyone have any tips?

Thanks!

Arthur

Hi Arthur,

This might (emphasis on “might”) be possible by taking a camera shot, then using “.colorSample()” in a loop of many random iterations across the entire screen, then gathering up the RGB+A data and “averaging” it out somehow.

http://docs.coronalabs.com/api/library/display/colorSample.html

However, the performance might suffer a bit if you take like 100 color samples, and I’m not sure how accurate the entire thing would be. I guess you’d just have to test it out.  :) Also, I think .colorSample() might be a Pro/Enterprise-only feature.

Best regards,

Brent

There are light meter apps out there, but they are all native.  According to a couple of stackoverlow posts, you can probably do it with Corona Enterprise as you need to call some native calls:

http://stackoverflow.com/questions/18271145/accessing-the-ambient-light-sensor-in-ios

Doesn’t look hard, but it’s a feature that won’t benefit many Corona Users so it likely won’t make it into the core.

Rob

Thanks for the replies gentlemen!

Regards,

Arthur

Hi Arthur,

This might (emphasis on “might”) be possible by taking a camera shot, then using “.colorSample()” in a loop of many random iterations across the entire screen, then gathering up the RGB+A data and “averaging” it out somehow.

http://docs.coronalabs.com/api/library/display/colorSample.html

However, the performance might suffer a bit if you take like 100 color samples, and I’m not sure how accurate the entire thing would be. I guess you’d just have to test it out.  :) Also, I think .colorSample() might be a Pro/Enterprise-only feature.

Best regards,

Brent

There are light meter apps out there, but they are all native.  According to a couple of stackoverlow posts, you can probably do it with Corona Enterprise as you need to call some native calls:

http://stackoverflow.com/questions/18271145/accessing-the-ambient-light-sensor-in-ios

Doesn’t look hard, but it’s a feature that won’t benefit many Corona Users so it likely won’t make it into the core.

Rob

Thanks for the replies gentlemen!

Regards,

Arthur