hcToHex method

String hcToHex({
  1. bool leadingHashSign = true,
  2. bool includeAlpha = false,
})

return hex String

Implementation

String hcToHex({bool leadingHashSign = true, bool includeAlpha = false}) =>
    '${leadingHashSign ? '#' : ''}'
    '${includeAlpha ? alpha.toRadixString(16).padLeft(2, '0') : ''}'
    '${red.toRadixString(16).padLeft(2, '0')}'
    '${green.toRadixString(16).padLeft(2, '0')}'
    '${blue.toRadixString(16).padLeft(2, '0')}';