toColor method

Color toColor()

Implementation

Color toColor() {
  String hexCode = startsWith('#') ? substring(1) : this;

  if (hexCode.length == 6) {
    hexCode = 'FF$hexCode';
  }

  return Color(int.parse('0x$hexCode'));
}