Lines Matching refs:backgroundColor

332      * @param backgroundColor the color to ensure contrast against.
336 public static int findAlphaToMeetContrast(int color, int backgroundColor, double minRatio) {
338 int bg = backgroundColor;
472 int backgroundColor) {
474 backgroundColor, false /* isDark */);
482 * @param backgroundColor the background color to ensure the contrast against.
488 int backgroundColor, boolean isDark) {
492 color = NotificationColorUtil.ensureTextContrast(color, backgroundColor, isDark);
500 NotificationColorUtil.contrastChange(resolvedColor, color, backgroundColor),
541 public static int resolvePrimaryColor(Context context, int backgroundColor) {
542 boolean useDark = shouldUseDark(backgroundColor);
552 public static int resolveSecondaryColor(Context context, int backgroundColor) {
553 boolean useDark = shouldUseDark(backgroundColor);
563 public static int resolveDefaultColor(Context context, int backgroundColor) {
564 boolean useDark = shouldUseDark(backgroundColor);
594 private static boolean shouldUseDark(int backgroundColor) {
595 boolean useDark = backgroundColor == Notification.COLOR_DEFAULT;
597 useDark = ColorUtilsFromCompat.calculateLuminance(backgroundColor) > 0.5;
602 public static double calculateLuminance(int backgroundColor) {
603 return ColorUtilsFromCompat.calculateLuminance(backgroundColor);
607 public static double calculateContrast(int foregroundColor, int backgroundColor) {
608 return ColorUtilsFromCompat.calculateContrast(foregroundColor, backgroundColor);
611 public static boolean satisfiesTextContrast(int backgroundColor, int foregroundColor) {
612 return NotificationColorUtil.calculateContrast(foregroundColor, backgroundColor) >= 4.5;
622 public static boolean isColorLight(int backgroundColor) {
623 return calculateLuminance(backgroundColor) > 0.5f;