isAccentColor static method
Check if the given color is included in any Material accent color swatch.
Returns true if the color is a Material accent color, otherwise false.
Implementation
static bool isAccentColor(Color color) {
for (final ColorSwatch<Object> swatch in accentColors) {
for (final int i in _indexAccent) {
if (swatch[i] == color || swatch[i]?.value32bit == color.value32bit) {
return true; // Color found in a swatch, return true.
}
}
}
// Color was not in any standard Material accent color swatch, return false.
return false;
}