primaryColorHex static method

Color primaryColorHex(
  1. String primaryColorString
)

Implementation

static Color primaryColorHex(String primaryColorString) {
  final buffer = StringBuffer();
  if (primaryColorString.length == 6 || primaryColorString.length == 7) {
    buffer.write('ff');
  }

  buffer.write(primaryColorString.replaceFirst('#', ''));
  return Color(int.parse(buffer.toString(), radix: 16));
}