getChannel function

int getChannel(
  1. int color,
  2. Channel channel
)

Get the channel from the color.

Implementation

int getChannel(int color, Channel channel) => channel == Channel.red
    ? getRed(color)
    : channel == Channel.green
        ? getGreen(color)
        : channel == Channel.blue
            ? getBlue(color)
            : channel == Channel.alpha
                ? getAlpha(color)
                : getLuminance(color);