apply method

ZetaPureColorSwatch apply({
  1. ZetaContrast contrast = ZetaContrast.aa,
  2. Brightness brightness = Brightness.light,
})

Creates a copy of the current ZetaColorSwatch with potential modifications based on the provided contrast and brightness.

The contrast determines which shade of the color should be used as the primary color in the copied swatch.

  • contrast : The shade to use as the primary color in the new swatch. Defaults to ZetaContrast.aa.
  • brightness : The brightness value for the new swatch. Defaults to Brightness.light.

Implementation

ZetaPureColorSwatch apply({
  ZetaContrast contrast = ZetaContrast.aa,
  Brightness brightness = Brightness.light,
}) {
  if (this.brightness == brightness) return this;

  return ZetaPureColorSwatch(
    brightness: brightness,
    primary: this[500]!.value,
    swatch: {
      0: this[0]!,
      500: this[500]!,
      1000: this[1000]!,
    },
  );
}