isCustomColor static method
Check if a color is included in a custom color swatches.
Returns true if the color is a custom swatch, otherwise false.
Implementation
static bool isCustomColor(
Color color, Map<ColorSwatch<Object>, String>? customSwatch) {
if (customSwatch != null) {
for (final ColorSwatch<Object> swatch in customSwatch.keys) {
for (final int i in _indexPrimary) {
if (swatch[i] == color || swatch[i]?.value32bit == color.value32bit) {
return true; // Color found in a swatch, return true.
}
}
}
}
// Did not find the given color in a custom swatch, return false.
return false;
}