trait ColorshiftTrait in Image Effects 8.3
Same name and namespace in other branches
- 8 src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ColorshiftTrait
- 8.2 src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php \Drupal\image_effects\Plugin\ImageToolkit\Operation\ColorshiftTrait
Base trait for image_effects Colorshift operations.
Hierarchy
- trait \Drupal\image_effects\Plugin\ImageToolkit\Operation\ColorshiftTrait
2 files declare their use of ColorshiftTrait
- Colorshift.php in src/
Plugin/ ImageToolkit/ Operation/ gd/ Colorshift.php - Colorshift.php in src/
Plugin/ ImageToolkit/ Operation/ imagemagick/ Colorshift.php
File
- src/
Plugin/ ImageToolkit/ Operation/ ColorshiftTrait.php, line 10
Namespace
Drupal\image_effects\Plugin\ImageToolkit\OperationView source
trait ColorshiftTrait {
/**
* {@inheritdoc}
*/
protected function arguments() {
return [
'RGB' => [
'description' => 'The RGB of the color shift.',
],
];
}
/**
* {@inheritdoc}
*/
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ColorshiftTrait:: |
protected | function | ||
ColorshiftTrait:: |
protected | function |