You are here

protected function ColorshiftTrait::validateArguments in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ColorshiftTrait::validateArguments()
  2. 8.2 src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ColorshiftTrait::validateArguments()

File

src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php, line 26

Class

ColorshiftTrait
Base trait for image_effects Colorshift operations.

Namespace

Drupal\image_effects\Plugin\ImageToolkit\Operation

Code

protected function validateArguments(array $arguments) {

  // Assure color is a valid hex string.
  if (!Color::validateHex($arguments['RGB'])) {
    throw new \InvalidArgumentException("Invalid color ('{$arguments['RGB']}') specified for the image 'colorshift' operation");
  }
  return $arguments;
}