Color calculateTextColor(Color background) { return background.computeLuminance() >= 0.5 ? Colors.black : Colors.white; }