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

File

src/Plugin/Field/FieldFormatter/ColorFieldFormatterText.php, line 57

Class

ColorFieldFormatterText
Plugin implementation of the color_field text formatter.

Namespace

Drupal\color_field\Plugin\Field\FieldFormatter

Code

public function settingsSummary() : array {
    $opacity = $this->getFieldSetting('opacity');
    $settings = $this->getSettings();
    $summary = [];
    $summary[] = $this->t('@format', [
        '@format' => $this->getColorFormat($settings['format']),
    ]);
    if ($opacity && $settings['opacity']) {
        $summary[] = $this->t('Display with opacity.');
    }
    return $summary;
}