anishathalye / lumen

Magic auto brightness based on screen contents 💡

Home Page:https://anishathalye.com/lumen/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adjustable brightness transition time

ozguncagri opened this issue · comments

Yesterday I used it for a while and idea is really good but faster brightness changes gives me a headache. Brightness changes could be more slower or transition time could be adjustable by some settings.

Yeah, it would be nice to make this tunable!

@anishathalye Great work! I've been in search of something just similar. Though I'm new to swift but not new to programming.

Can you point out where exactly you have specified the transition delay? Also, where are the calculations for minimum and maximum brightness?

Thank you.

I propose to make the tick interval adjustable, in essence making the app respond faster or slower to changes. Right now, 0.5s is too fast. Just switching from one email to another in Apple Mail makes it blind me with a brief flash of light.

I'd be happy to accept a pull request for an adjustable tick interval.

@anishathalye I've already forked and tested a modified tick rate. It's not the solution here. A tick rate any longer than 0.7 and the same issue raised here becomes more visible. For example, switching from a dark full-screen app to a lighter desktop gives you a longer exposure to bright light from the backlight + the lighter pixels.

I gave this some thought and I think the only solution to the problem of blinding the viewer is a dynamic adjustment speed curve. For example, if the light to dark delta is >2x, increase the backlight in increments of 10%/s (ie. fast) and this is equivalent in reverse delta as well. If the delta is 0.5x, adjust the backlight in increments of 1%/s. Make these increments adjustable (options inside the app), and I think we've got a good solution. I'm not a maths expert so maybe someone else can (in)validate the idea.

Just an example where I had issues. I had the Mail app open with the new Dark mode in Mojave. I opted to let the email background stay white (Apple Mail inverts white and dark font colors to fix the dark text on dark background color problem but sometimes it fails, like with darker gray texts which stay dark). So I had a mix of white and and black on my screen. Then when I wanted to select a few emails to delete them, Apple Mail briefly erases the right hand side where the email content is and draws a stack of selected emails. In that brief moment, Lumen saw that the screen went darker, increased the brightness and then when the stack finished drawing and the top email being white, I was blinded by bright light for a second before Lumen saw that the screen lightened back up and it reduced the backlight to approximately where it was before.