function ColorizeImageEffect::buildConfigurationForm
File
-
modules/image_example/src/Plugin/ImageEffect/ColorizeImageEffect.php, line 106
Class
- ColorizeImageEffect
- Colorizes an image resource.
Namespace
Drupal\image_example\Plugin\ImageEffect
Code
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form['color'] = [
'#type' => 'textfield',
'#title' => $this->t('Color'),
'#description' => $this->t('The color to use when colorizing the image. Use web-style hex colors, for example %long-value, or %short-value.', [
'%long-value' => '#FF6633',
'%short-value' => 'F63',
]),
'#default_value' => $this->configuration['color'] ?? '',
'#size' => 7,
'#max_length' => 7,
'#required' => TRUE,
];
return $form;
}