withBlack method
The value subtract
is subtracted from each RGB channel of this
and clamped to be non-negative.
Alpha channel of the returned color is maintained from this
unless
a convenience pass is made for dynamic
strength
, which may be a
double ranging 0..1
to represent opacity or an int ranging 2..255
to represent alpha.
This method is equal but opposite to withWhite. A negative value provided here is equivalent to the positive version of that value given to withWhite.
Implementation
Color withBlack(int subtract, [dynamic strength]) => Color.fromARGB(
alphaFromStrength(strength) ?? alpha,
(red - subtract).restricted,
(green - subtract).restricted,
(blue - subtract).restricted,
);