getColor method

  1. @override
Color getColor(
  1. num r,
  2. num g,
  3. num b, [
  4. num? a,
])
override

Create a Color object with the format and number of channels of the image.

Implementation

@override
Color getColor(num r, num g, num b, [num? a]) => a == null
    ? ColorRgb8(r.clamp(0, 255).toInt(), g.clamp(0, 255).toInt(),
        b.clamp(0, 255).toInt())
    : ColorRgba8(r.clamp(0, 255).toInt(), g.clamp(0, 255).toInt(),
        b.clamp(0, 255).toInt(), a.clamp(0, 255).toInt());