isChannelPowerless method
Returns whether the given channel
in this color is powerless.
If this came from a function argument, colorName
is the argument name
for this color and channelName
is the argument name for channel
(without the $
). These are used for error reporting.
Implementation
bool isChannelPowerless(String channel,
{String? colorName, String? channelName}) {
var channels = space.channels;
if (channel == channels[0].name) return isChannel0Powerless;
if (channel == channels[1].name) return isChannel1Powerless;
if (channel == channels[2].name) return isChannel2Powerless;
if (channel == 'alpha') return false;
throw SassScriptException(
"Color $this doesn't have a channel named \"$channel\".", channelName);
}