getLuminance function

num getLuminance(
  1. Color c
)

Returns the luminance (grayscale) value of the color.

Implementation

num getLuminance(Color c) => 0.299 * c.r + 0.587 * c.g + 0.114 * c.b;