color_palette_color_value

color_palette_color_value($element, $input = FALSE, FormStateInterface $form_state) Determines the value for a palette color field. Parameters array $element: The form element whose value is being populated. string|bool $input: The incoming input to populate the form element. If this is FALSE, the element's default value should be returned. \Drupal\Core\Form\FormStateInterface $form_state: The current state of the form. Return value string The data that will appear in the $form_state->getV

color_get_info

color_get_info($theme) Retrieves the Color module information for a particular theme. File core/modules/color/color.module, line 139 Allows users to change the color scheme of themes. Code function color_get_info($theme) { static $theme_info = array(); if (isset($theme_info[$theme])) { return $theme_info[$theme]; } $path = drupal_get_path('theme', $theme); $file = \Drupal::root() . '/' . $path . '/color/color.inc'; if ($path && file_exists($file)) { include $file

color_scheme_form

color_scheme_form($complete_form, FormStateInterface $form_state, $theme) Form constructor for the color configuration form for a particular theme. Parameters $theme: The machine name of the theme whose color settings are being configured. See also color_scheme_form_validate() color_scheme_form_submit() File core/modules/color/color.module, line 200 Allows users to change the color scheme of themes. Code function color_scheme_form($complete_form, FormStateInterface $form_state, $theme) {

color_get_palette

color_get_palette($theme, $default = FALSE) Retrieves the color palette for a particular theme. File core/modules/color/color.module, line 174 Allows users to change the color scheme of themes. Code function color_get_palette($theme, $default = FALSE) { // Fetch and expand default palette. $info = color_get_info($theme); $palette = $info['schemes']['default']['colors']; if ($default) { return $palette; } // Load variable. // @todo Default color config should be moved to ya

ColorConfigCacheInvalidator::getSubscribedEvents

public static ColorConfigCacheInvalidator::getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $prio

color_form_system_theme_settings_alter

color_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) Implements hook_form_FORM_ID_alter(). File core/modules/color/color.module, line 51 Allows users to change the color scheme of themes. Code function color_form_system_theme_settings_alter(&$form, FormStateInterface $form_state) { $build_info = $form_state->getBuildInfo(); if (isset($build_info['args'][0]) && ($theme = $build_info['args'][0]) && color_get_info($theme) && functi

color_block_view_system_branding_block_alter

color_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) Implements hook_block_view_BASE_BLOCK_ID_alter(). File core/modules/color/color.module, line 113 Allows users to change the color scheme of themes. Code function color_block_view_system_branding_block_alter(array &$build, BlockPluginInterface $block) { $build['#pre_render'][] = 'color_block_view_pre_render'; }

ColorConfigCacheInvalidator::onChange

public ColorConfigCacheInvalidator::onChange(ConfigCrudEvent $event) Invalidate cache tags when a color theme config object changes. Parameters \Drupal\Core\Config\ConfigCrudEvent $event: The Event to process. File core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php, line 38 Class ColorConfigCacheInvalidator A subscriber invalidating cache tags when color config objects are saved. Namespace Drupal\color\EventSubscriber Code public function onChange(ConfigCrudEvent $

color_block_view_pre_render

color_block_view_pre_render(array $build) #pre_render callback: Sets color preset logo. File core/modules/color/color.module, line 120 Allows users to change the color scheme of themes. Code function color_block_view_pre_render(array $build) { $theme_key = \Drupal::theme()->getActiveTheme()->getName(); $config = \Drupal::config('color.theme.' . $theme_key); CacheableMetadata::createFromRenderArray($build) ->addCacheableDependency($config) ->applyTo($build); // Ove

ColorConfigCacheInvalidator::$cacheTagsInvalidator

The cache tags invalidator. Type: \Drupal\Core\Cache\CacheTagsInvalidatorInterface File core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php, line 20 Class ColorConfigCacheInvalidator A subscriber invalidating cache tags when color config objects are saved. Namespace Drupal\color\EventSubscriber Code protected $cacheTagsInvalidator;