blackness property

double get blackness

This color's blackness, a percentage between 0 and 100.

Implementation

double get blackness {
  // Because HWB is (currently) used much less frequently than HSL or RGB, we
  // don't cache its values because we expect the memory overhead of doing so
  // to outweigh the cost of recalculating it on access.
  return 100 - math.max(math.max(red, green), blue) / 255 * 100;
}