public function isValidChannelValue($value, $channel)
    {
        if (!in_array($channel, self::$channels)) {
            throw new \InvalidArgumentException('Invalid Channel Name');
        }

        if ($channel == self::CHANNEL_ALPHA) {
            if ($value >= 0 && $value <= 127) {
                return true;
            }
        } else {
            if ($value >= 0 && $value <= 255) {
                return true;
            }
        }

        return false;
    }
public function isValidChannelValue($value, $channel)
    {
        if (!in_array($channel, self::$channels)) {
            throw new \InvalidArgumentException('Invalid Channel Name');
        }

        if ($channel == self::CHANNEL_ALPHA) {
            if ($value >= 0 && $value <= 127) {
                return true;
            }
        } else {
            if ($value >= 0 && $value <= 255) {
                return true;
            }
        }

        return false;
    }
public function isValidChannelValue ( $ value , $ channel ) { if ( ! in_array ( $ channel , self :: $ channels ) ) { throw new \ InvalidArgumentException ( 'Invalid Channel Name' ) ; } if ( $ channel == self :: CHANNEL_ALPHA ) { if ( $ value >= 0 && $ value <= 127 ) { return true ; } } else { if ( $ value >= 0 && $ value <= 255 ) { return true ; } } return false ; }
Check if the given value is valid for the given channel name

@param integer $value
@param string  $channel on of the following :
- RGBColor::CHANNEL_RED
- RGBColor::CHANNEL_GREEN,
- RGBColor::CHANNEL_BLUE,
- RGBColor::CHANNEL_ALPHA,

@return boolean
@throws \InvalidArgumentException if the channel name is not supported
Check if the given value is valid for the given channel name