anchor.diff:      // Design spec shows for its color palette on
       // <https://material.io/guidelines/style/color.html#color-color-palette>.
       const double kThreshold = 0.15;
  -    if ((L + 0.05) * (L + 0.05) > kThreshold )
  +    if ((relativeLuminance + 0.05) * (relativeLuminance + 0.05) > kThreshold )
         return Brightness.light;
       return Brightness.dark;
     }
  
positive.code: // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  
  import 'dart:math' as math;
  import 'dart:ui' show Color, hashValues;
  
  import 'package:flutter/foundation.dart';
  
negative.code:     );
    }
  
    /// Determines whether the given [Color] is [Brightness.light] or
    /// [Brightness.dark].
    ///
    /// This compares the luminosity of the given color to a threshold value that
    /// matches the material design specification.
    static Brightness estimateBrightnessForColor(Color color) {
      final double relativeLuminance = color.computeLuminance();
  
      // See <https://www.w3.org/TR/WCAG20/#contrast-ratiodef>
      // The spec says to use kThreshold=0.0525, but Material Design appears to bias
  