You are here

protected function Color::getTextColor in GridStack 8.2

Returns the text colors grouped by the given key.

1 call to Color::getTextColor()
Style::getStyles in src/Plugin/gridstack/stylizer/Style.php
Parses the given color strings keyed by index or .box__content or selector.

File

src/Plugin/gridstack/stylizer/Color.php, line 21

Class

Color
Provides the color styles.

Namespace

Drupal\gridstack\Plugin\gridstack\stylizer

Code

protected function getTextColor(array $settings) {
  $build = [];
  if ($colors = $this
    ->getColors($settings)) {
    $data = $this
      ->getSelector($settings);
    $selector = $data['selector'];

    // The text element has unique key as their own selector.
    foreach (GridStackDefault::textElements() as $key) {
      if ($key != 'text' && !empty($colors[$key])) {
        $selector = $selector ? $selector . ' ' . $key : $key;
        $build[$selector] = 'color:' . $colors[$key] . ';';
      }
    }
  }
  return $build;
}