toColor property

Color get toColor

Implementation

Color get toColor {
  final buffer = StringBuffer();
  final color = this;
  if (color.length == 6 || color.length == 7) buffer.write('ff');
  buffer.write(color.replaceFirst('#', ''));
  return Color(int.parse(buffer.toString(), radix: 16));
}