parseColor method

Color parseColor(
  1. String cStr
)

Implementation

Color parseColor(String cStr) {
  if (cStr.isEmpty)
    throw UnsupportedError("Empty color field found.");
  if (cStr[0] == '#') {
    return Color(0xff000000 | int.parse(cStr.substring(1), radix: 16));
  } else if (cStr == 'none') {
    return Colors.transparent;
  } else {
    throw UnsupportedError(
        "Only hex color format currently supported. String:  $cStr");
  }
}