withBrightness method

FamilyDefinition withBrightness(
  1. FamilyDefinition def
)

def with its brightness draw fixed to the intent's, when def can draw it (engine v5 families with their own palettes).

Implementation

FamilyDefinition withBrightness(FamilyDefinition def) {
  final b = brightnessFor(def);
  if (b == null) return def;
  return def.revise(
    brightnessWeights: b == ThemeBrightness.dark
        ? const [1, 0]
        : const [0, 1],
  );
}