namedColorToColor static method

Color? namedColorToColor(
  1. String text
)

Implementation

static Color? namedColorToColor(String text) {
   String namedColor = namedColors.keys.firstWhere((element) => element.toLowerCase() == text.toLowerCase(), orElse: () => "");
   if (namedColor != "") {
     return stringToColor(namedColors[namedColor]!);
   } else {
     return null;
   }
}