materialNameAndARGBCode static method
String
materialNameAndARGBCode(
- Color color, {
- Map<
ColorSwatch< ? colorSwatchNameMap,Object> , String>
Returns the official Material color name for the color passed to it, including the shade index and ARGB style HexCode.
If it is not a Material color or one of the Accents colors, only the ARGB style Hex code is returned.
Implementation
static String materialNameAndARGBCode(Color color,
{Map<ColorSwatch<Object>, String>? colorSwatchNameMap}) {
final String name =
materialName(color, colorSwatchNameMap: colorSwatchNameMap);
if (name == '') {
// This is not a material color, we just return it's Flutter like HEX code
return '(${colorCode(color)})';
} else {
return '$name (${colorCode(color)})';
}
}