Moved a method to the ColorUtil class
This commit is contained in:
parent
357ef1df69
commit
abedc48f23
2 changed files with 6 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue