getHexFromColor static method

String getHexFromColor(
  1. Color color
)

Get HEX code from Colors, MaterialColor, Color and MaterialAccentColor

Implementation

static String getHexFromColor(Color color) {
  return '#${color.value.toRadixString(16).padLeft(8, '0').substring(2)}';
}