ColorshiftTrait.php in Image Effects 8
File
src/Plugin/ImageToolkit/Operation/ColorshiftTrait.php
View source
<?php
namespace Drupal\image_effects\Plugin\ImageToolkit\Operation;
use Drupal\Component\Utility\Color;
trait ColorshiftTrait {
protected function arguments() {
return [
'RGB' => [
'description' => 'The RGB of the color shift.',
],
];
}
protected function validateArguments(array $arguments) {
if (!Color::validateHex($arguments['RGB'])) {
throw new \InvalidArgumentException("Invalid color ('{$arguments['RGB']}') specified for the image 'colorshift' operation");
}
return $arguments;
}
}