color_library_info_alter

color_library_info_alter(&$libraries, $extension) Implements hook_library_info_alter(). Replaces style sheets declared in libraries with color-altered style sheets. File core/modules/color/color.module, line 74 Allows users to change the color scheme of themes. Code function color_library_info_alter(&$libraries, $extension) { $themes = array_keys(\Drupal::service('theme_handler')->listInfo()); if (in_array($extension, $themes)) { $color_paths = \Drupal::config('color.theme.

color_help

color_help($route_name, RouteMatchInterface $route_match) Implements hook_help(). File core/modules/color/color.module, line 22 Allows users to change the color scheme of themes. Code function color_help($route_name, RouteMatchInterface $route_match) { switch ($route_name) { case 'help.page.color': $output = '<h3>' . t('About') . '</h3>'; $output .= '<p>' . t('The Color module allows users with the <em>Administer site configuration</em> permissi

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

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_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'; }

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::__construct

public ColorConfigCacheInvalidator::__construct(CacheTagsInvalidatorInterface $cache_tags_invalidator) Constructs a ColorConfigCacheInvalidator object. Parameters \Drupal\Core\Cache\CacheTagsInvalidatorInterface $cache_tags_invalidator: The cache tags invalidator. File core/modules/color/src/EventSubscriber/ColorConfigCacheInvalidator.php, line 28 Class ColorConfigCacheInvalidator A subscriber invalidating cache tags when color config objects are saved. Namespace Drupal\color\EventSubs

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 $

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