toGrayscale method

void toGrayscale (Vector4 input, Vector4 result)

Convert a input color to a gray scaled color and store it in result.

Implementation

static void toGrayscale(Vector4 input, Vector4 result) {
  final double value = 0.21 * input.r + 0.71 * input.g + 0.07 * input.b;

  result
    ..r = value
    ..g = value
    ..b = value
    ..a = input.a;
}