copyWith method

ZetaColors copyWith({
  1. Brightness? brightness,
  2. ZetaContrast? contrast,
  3. ZetaColorSwatch? primary,
  4. ZetaColorSwatch? secondary,
  5. ZetaColorSwatch? error,
  6. ZetaColorSwatch? cool,
  7. ZetaColorSwatch? warm,
  8. Color? white,
  9. Color? black,
  10. Color? surfacePrimary,
  11. Color? surfaceSecondary,
  12. Color? surfaceTertiary,
  13. @Deprecated('This color has been deprecated as of v0.10.0') Color? link,
  14. @Deprecated('This color has been deprecated as of v0.10.0') Color? linkVisited,
  15. @Deprecated('This color has been deprecated as of v0.10.0') Color? shadow,
})

Applies new property values to ZetaColors and returns a new copy.

Each property defaults to the previous value if not specified.

Implementation

ZetaColors copyWith({
  Brightness? brightness,
  ZetaContrast? contrast,
  ZetaColorSwatch? primary,
  ZetaColorSwatch? secondary,
  ZetaColorSwatch? error,
  ZetaColorSwatch? cool,
  ZetaColorSwatch? warm,
  Color? white,
  Color? black,
  Color? surfacePrimary,
  Color? surfaceSecondary,
  Color? surfaceTertiary,
  @Deprecated('This color has been deprecated as of v0.10.0') Color? link,
  @Deprecated('This color has been deprecated as of v0.10.0') Color? linkVisited,
  @Deprecated('This color has been deprecated as of v0.10.0') Color? shadow,
}) {
  return ZetaColors(
    white: white ?? this.white,
    black: black ?? this.black,
    brightness: brightness ?? this.brightness,
    contrast: contrast ?? this.contrast,
    primary: primary ?? this.primary,
    secondary: secondary ?? this.secondary,
    error: error ?? this.error,
    cool: cool ?? this.cool,
    warm: warm ?? this.warm,
    surfacePrimary: surfacePrimary ?? this.surfacePrimary,
    surfaceSecondary: surfaceSecondary ?? this.surfaceSecondary,
    surfaceTertiary: surfaceTertiary ?? this.surfaceTertiary,
    adjust: (brightness != null && brightness != this.brightness) || (contrast != null && contrast != this.contrast),
  );
}