Calculates the contrast color for a given color.
Color getContrastColor(Color color) { int d = color.computeLuminance() > 0.5 ? 0 : 255; return Color.fromARGB(color.alpha, d, d, d); }