lesbarAuf function

Farbe lesbarAuf(
  1. Farbe grund, {
  2. Farbe hell = const Farbe(0xFF, 0xFF, 0xFF),
  3. Farbe dunkel = const Farbe(0x0F, 0x17, 0x2A),
})

Die besser lesbare von zwei Farben auf grund.

Implementation

Farbe lesbarAuf(Farbe grund, {Farbe hell = const Farbe(0xFF, 0xFF, 0xFF), Farbe dunkel = const Farbe(0x0F, 0x17, 0x2A)}) {
  return kontrast(hell, grund) >= kontrast(dunkel, grund) ? hell : dunkel;
}