isDark static method

bool isDark(
  1. String hex
)

Returns true or false if the calculated relative luminance from the given hex is less than 0.5.

Implementation

static bool isDark(String hex) {
  var bC = basicColorsFromHex(hex);

  return calculateRelativeLuminance(
          bC[BASIC_COLOR_RED]!, bC[BASIC_COLOR_GREEN]!, bC[BASIC_COLOR_BLUE]!) <
      0.5;
}