feat(force invert): detect the polarity of an app to decide if we should force invert it
Added the ColorArea class to track the app's overall polarity (i.e. dark or light theme) by counting the areas of backgrounds and their colors. This is used to determine if we should force invert the app, for instance if the user prefers dark theme but this app is mainly light. The idea is that we count the fill colors of any background-type draw calls: drawRect(), drawColor(), etc. If the area of light fills drawn to the screen is greater than the area of dark fills drawn to the screen, we can reasonably guess that the app is light theme, and vice-versa. Bug: 372558459 Flag: android.view.accessibility.force_invert_color Test: atest hwui_unit_tests Change-Id: I524c3f5cde0a65cad4087aeefdec8eb0477a7971
Loading
Please register or sign in to comment