tertiary property

  1. @override
DynamicColor get tertiary
override

Implementation

@override
DynamicColor get tertiary {
  final color2025 = DynamicColor(
    name: "tertiary",
    palette: (scheme) => scheme.tertiaryPalette,
    tone: (scheme) {
      if (scheme.platform == .watch) {
        return scheme.variant == .tonalSpot
            ? _tMaxC(scheme.tertiaryPalette, 0, 90)
            : _tMaxC(scheme.tertiaryPalette);
      } else if (scheme.variant == .expressive ||
          scheme.variant == .vibrant) {
        return _tMaxC(
          scheme.tertiaryPalette,
          /* lowerBound= */ 0,
          /* upperBound= */ Hct.isCyan(scheme.tertiaryPalette.hue)
              ? 88
              : (scheme.isDark ? 98 : 100),
        );
      } else {
        // NEUTRAL and TONAL_SPOT
        return scheme.isDark
            ? _tMaxC(scheme.tertiaryPalette, 0, 98)
            : _tMaxC(scheme.tertiaryPalette);
      }
    },
    isBackground: true,
    background: (scheme) {
      if (scheme.platform == .phone) {
        return scheme.isDark ? surfaceBright : surfaceDim;
      } else {
        return surfaceContainerHigh;
      }
    },
    contrastCurve: (scheme) => scheme.platform == .phone
        ? _getContrastCurve(4.5)
        : _getContrastCurve(7),
    toneDeltaPair: (scheme) => scheme.platform == .phone
        ? ToneDeltaPair(
            roleA: tertiaryContainer,
            roleB: tertiary,
            delta: 5.0,
            polarity: .relativeLighter,
            constraint: .farther,
          )
        : null,
  );
  return super.tertiary.extendSpecVersion(.spec2025, color2025);
}