getLuminanceRgb function

int getLuminanceRgb (
  1. int r,
  2. int g,
  3. int b
)

Returns the luminance (grayscale) value of the color.

Implementation

int getLuminanceRgb(int r, int g, int b) =>
    (0.299 * r + 0.587 * g + 0.114 * b).round();