convertToHex static method

String convertToHex(
  1. Color color
)

Implementation

static String convertToHex(Color color) {
  String red = color.red.toRadixString(16).padLeft(2);
  String green = color.green.toRadixString(16).padLeft(2);
  String blue = color.blue.toRadixString(16).padLeft(2);
  return '#$red$green$blue';
}