brightness property

double get brightness

Gets the brightness of this color (0.0 to 1.0)

Implementation

double get brightness {
  return (((r * 255.0).round() & 0xff) * 0.299 +
          ((g * 255.0).round() & 0xff) * 0.587 +
          ((b * 255.0).round() & 0xff) * 0.114) /
      255.0;
}