Sieht eine Farbangabe wie #RRGGBB aus?
#RRGGBB
static bool isHex(String hex) { final h = hex.trim().replaceFirst('#', ''); return h.length == 6 && int.tryParse(h, radix: 16) != null; }