Same name and namespace in other branches
  1. 8.x-2.x src/Plugin/Field/FieldType/ColorFieldType.php \Drupal\color_field\Plugin\Field\FieldType\ColorFieldType::fieldSettingsForm() 1 comment

File

src/Plugin/Field/FieldType/ColorFieldType.php, line 59

Class

ColorFieldType
Plugin implementation of the 'color_type' field type.

Namespace

Drupal\color_field\Plugin\Field\FieldType

Code

public function fieldSettingsForm(array $form, FormStateInterface $form_state) : array {
    $element = [];
    $element['opacity'] = [
        '#type' => 'checkbox',
        '#title' => $this->t('Record opacity'),
        '#description' => $this->t('Whether or not to record.'),
        '#default_value' => $this->getSetting('opacity'),
    ];
    return $element;
}