Skip to content
Commit ee04476a authored by James O'Leary's avatar James O'Leary
Browse files

Update light/dark detection.

Reset implementation based on design being comfortable with white
shadows now, so there doesn't need to be a bias toward saying the
wallpaper is dark.

- use luminance/tone instead of HSL to judge contrast
- if the median pixel has a luminance/tone less than mid-gray, the
wallpaper is dark.
- add a method to ColorUtils that returns luminance from a hex code
without any allocations (avoids converting to LAB)

End result is we move from judging a wallpaper as dark ~99% of the time
to 54% of the time, based on Monet Studio implementation checking ~1000
wallpapers, including Google's default wallpapers.

Bug: 213314628
Test: Manual inspection at runtime, long-running prototyping in Monet
Studio with UX across ~1000 wallpapers
Change-Id: Ia9122142728a8de9390b3e0471d7803376487864
parent abfe2878
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment