hexToColor static method

Color hexToColor(
  1. String hex
)

Implementation

static Color hexToColor(String hex) {
  hex = hex.replaceAll('#', '').trim();
  if (hex.length == 6) hex = 'FF$hex';
  return Color(int.parse(hex, radix: 16));
}