function color_get_palette

Retrieves the color palette for a particular theme.

3 calls to color_get_palette()
color_scheme_form in drupal/core/modules/color/color.module
Form constructor for the color configuration form for a particular theme.
color_scheme_form_submit in drupal/core/modules/color/color.module
Form submission handler for color_scheme_form().
_color_rewrite_stylesheet in drupal/core/modules/color/color.module
Rewrites the stylesheet to match the colors in the palette.

File

drupal/core/modules/color/color.module, line 131
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 yaml in the theme.
  return config('color.' . $theme)
    ->get('palette') ?: $palette;
}