fluent2BrandWell function

Color fluent2BrandWell(
  1. Fluent2ThemeData t, [
  2. Fluent2Press press = Fluent2Press.rest
])

The brand tint a part lays on the ground (a chosen day and the range round it, a brand tile, a date block, a brand-chosen table row, the empty state's disc, a banner), in its press step: Fluent's brandBackground2, or its hover shade (and on) where the tint would all but vanish on the brand-tinted page (#EBF3FC stood 1.02:1 on lapis's page by day, and by night on every preset's but iris's), so it stands at least 1.15:1 from the page, unless the brand's second ink would fall under 4.5:1 on the shade (a designer's teal by night: 4.23), where the words outrank the tint.

Implementation

Color fluent2BrandWell(
  Fluent2ThemeData t, [
  Fluent2Press press = Fluent2Press.rest,
]) {
  final c = t.colors;
  final deep =
      Fluent2ThemeData.contrast(c.brandBackground2, t.background) < 1.15 &&
      Fluent2ThemeData.contrast(c.brandForeground2, c.brandBackground2Hover) >=
          4.5;
  return deep
      ? press.pick(
          c.brandBackground2Hover,
          c.brandBackground2Pressed,
          c.brandBackground2Pressed,
          c.brandBackground2Hover,
        )
      : press.pick(
          c.brandBackground2,
          c.brandBackground2Hover,
          c.brandBackground2Pressed,
          c.brandBackground2,
        );
}