isAccentColor static method

bool isAccentColor(
  1. Color color
)

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]?.value == color.value) {
        return true; // Color found in a swatch, return true.
      }
    }
  }
  // Color was not in any standard Material accent color swatch, return false.
  return false;
}