isDarkColor function

bool isDarkColor(
  1. UvRgb? c
)

Returns whether c is considered dark using HSL lightness.

Implementation

bool isDarkColor(UvRgb? c) {
  if (c == null) return true;
  final (_, _, l) = rgbToHsl(c.r, c.g, c.b);
  return l < 0.5;
}