isDark property Null safety

bool isDark

Determines whether the given PdfColor is dark.

Implementation

bool get isDark {
  final relativeLuminance = luminance;
  const kThreshold = 0.15;
  return (relativeLuminance + 0.05) * (relativeLuminance + 0.05) > kThreshold;
}