/** * Set color conversion strategy * * @param string $colorConversionStrategy * * @throws \InvalidArgumentException * * @return $this */ public function setColorConversionStrategy($colorConversionStrategy) { $colorConversionStrategy = ltrim($colorConversionStrategy, '/'); if (!in_array($colorConversionStrategy, ColorConversionStrategy::values())) { throw new \InvalidArgumentException('Invalid color conversion strategy argument'); } $this->setArgument(sprintf('-dColorConversionStrategy=/%s', $colorConversionStrategy)); return $this; }
public function testValues() { $values = [ColorConversionStrategy::LEAVE_COLOR_UNCHANGED, ColorConversionStrategy::USE_DEVICE_INDEPENDENT_COLOR, ColorConversionStrategy::GRAY, ColorConversionStrategy::SRGB, ColorConversionStrategy::CMYK]; $this->assertEquals($values, ColorConversionStrategy::values()); }