isBlackAndWhiteColor static method

bool isBlackAndWhiteColor(
  1. Color color
)

Check if a color is included in the custom black and white swatches.

Returns true if the color is a black or white swatch, otherwise false.

Implementation

static bool isBlackAndWhiteColor(Color color) {
  for (final ColorSwatch<Object> swatch in blackAndWhite) {
    for (final int i in _indexPrimary) {
      if (swatch[i] == color || swatch[i]?.value == color.value) {
        return true; // Color found in a swatch, return true.
      }
    }
  }
  // Did not find the given color in any black or white swatch, return false
  return false;
}