hexColor static method

Color hexColor(
  1. String c
)

Implementation

static Color hexColor(String c) {
  try {
    var hex = c.toLowerCase().replaceAll('#ff', '0xff');
    return Color(int.parse(hex));
  } catch (e) {
    if (kDebugMode) {
      print(e.toString());
    }
    return Colors.red;
  }
}