ColorMatrix.gain constructor
ColorMatrix.gain(
- double amount
Returns a gain transform that scales RGB channels by amount.
Implementation
factory ColorMatrix.gain(double amount) {
final factor = amount.clamp(0.0, double.infinity);
return ColorMatrix(<double>[
factor,
0,
0,
0,
0,
0,
factor,
0,
0,
0,
0,
0,
factor,
0,
0,
0,
0,
0,
1,
0,
]);
}