MCPcopy Create free account
hub / github.com/cinit/TMoe / isDarkTheme

Method isDarkTheme

app/src/main/java/cc/ioctl/tmoe/ui/Theme.java:610–616  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

608 }
609
610 public static boolean isDarkTheme() {
611 int backgroundColor = getColor(key_windowBackgroundWhite);
612 int textColor = getColor(key_windowBackgroundWhiteBlackText);
613 int bg = ((backgroundColor >> 16) & 0xff) * 2 + ((backgroundColor >> 8) & 0xff) * 7 + (backgroundColor & 0xff);
614 int fg = ((textColor >> 16) & 0xff) * 2 + ((textColor >> 8) & 0xff) * 7 + (textColor & 0xff);
615 return bg < fg;
616 }
617}

Callers 1

getNightModeMaskedMethod · 0.95

Calls 1

getColorMethod · 0.95

Tested by

no test coverage detected