static bool isValidHexColor(String colorStr) { return RegExp(r'^#([0-9A-F]{6}|[0-9A-F]{3}|[0-9A-F]{8})$', caseSensitive: false).hasMatch(colorStr); }