Moved a method to the ColorUtil class

This commit is contained in:
Karim Abou Zeid 2015-07-11 15:53:23 +02:00
commit abedc48f23
2 changed files with 6 additions and 1 deletions

View file

@ -48,4 +48,8 @@ public class ColorUtil {
new int[]{color}
);
}
public static boolean useDarkTextColorOnBackground(int backgroundColor) {
return (Color.red(backgroundColor) * 0.299 + Color.green(backgroundColor) * 0.587 + Color.blue(backgroundColor) * 0.114) > 186;
}
}