hexFromArgb static method

String hexFromArgb(
  1. int argb, {
  2. bool leadingHashSign = true,
})

Implementation

static String hexFromArgb(int argb, {bool leadingHashSign = true}) {
  final red = ColorUtils.redFromArgb(argb);
  final green = ColorUtils.greenFromArgb(argb);
  final blue = ColorUtils.blueFromArgb(argb);
  return '${leadingHashSign ? '#' : ''}'
      '${red.toRadixString(16).padLeft(2, '0').toUpperCase()}'
      '${green.toRadixString(16).padLeft(2, '0').toUpperCase()}'
      '${blue.toRadixString(16).padLeft(2, '0').toUpperCase()}';
}