setChannel function
Returns a new color, where the given color
's channel
has been
replaced with the given value
.
Implementation
int setChannel(int color, Channel channel, int value) => channel == Channel.red
? setRed(color, value)
: channel == Channel.green
? setGreen(color, value)
: channel == Channel.blue
? setBlue(color, value)
: channel == Channel.alpha
? setAlpha(color, value)
: color;