You are here

public function Html::preprocess in Open Social 8.6

Same name in this branch
  1. 8.6 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  2. 8.6 themes/socialbase/src/Plugin/Preprocess/Html.php \Drupal\socialbase\Plugin\Preprocess\Html::preprocess()
Same name and namespace in other branches
  1. 8.9 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  2. 8 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  3. 8.2 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  4. 8.3 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  5. 8.4 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  6. 8.5 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  7. 8.7 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()
  8. 8.8 themes/socialblue/src/Plugin/Preprocess/Html.php \Drupal\socialblue\Plugin\Preprocess\Html::preprocess()

Preprocess theme hook variables.

Parameters

array $variables: The variables array, passed by reference (modify in place).

string $hook: The name of the theme hook.

array $info: The theme hook info array.

Overrides Html::preprocess

File

themes/socialblue/src/Plugin/Preprocess/Html.php, line 19

Class

Html
Pre-processes variables for the "html" theme hook.

Namespace

Drupal\socialblue\Plugin\Preprocess

Code

public function preprocess(array &$variables, $hook, array $info) {
  parent::preprocess($variables, $hook, $info);
  $variables['colors'] = [];
  foreach (color_get_palette($variables['theme']['name']) as $key => $value) {
    $key = str_replace('-', '_', $key);
    $variables['colors'][$key] = $value;
  }
}