esp-mqtt-rgb-led icon indicating copy to clipboard operation
esp-mqtt-rgb-led copied to clipboard

Add gamma correction

Open makzdot opened this issue 7 years ago • 2 comments

Hi,

Thank you for writing and sharing this code. I do have one enhancement if possible. I'm new to the ESP&Arduino in general so am not able to contribute myself (yet). What i noticed that when setting the LED to yellow (i.e. #FFFF00). The light produces a more green then yellow light. And in general the true colors are somewhat "off".

So I think a gamma correction could/should be added. I found something in the likes of this: https://learn.adafruit.com/led-tricks-gamma-correction/the-quick-fix

If this is what is needed it should fairly easy to implement. What do you think?

Thanks & kind regards, Max

makzdot avatar Apr 16 '17 08:04 makzdot

Hmm... This is really interesting, @makzdot. I've struggled with this issue in the past, and I hadn't seen such a simple fix.

I'll take a look at adding this solution to the project. I'll probably leave it as a configuration option (or an entirely different file) because some lights might not exhibit the same issue.

I'm working on some other projects right now, but I will leave this issue open to remind me soon.

If you, or anyone, would like to open a PR for this change, I welcome it.

corbanmailloux avatar Apr 17 '17 00:04 corbanmailloux

Hi @corbanmailloux, Thanks for your response. In the meantime I've been experementing and made a tinsy bit of progress. With this solution the colors are a little bit more accurate. Still not perfect though. But the oranges and yellows match up way better to actual RGB codes than before. And that is a win. I'll make a pull request soon.

makzdot avatar Apr 17 '17 13:04 makzdot