1 color.module color_get_palette($theme, $default = FALSE)

Retrieves the color palette for a particular theme.

File

core/modules/color/color.module, line 410
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'];

  // Load config.
  if (!$default && ($theme_palette = theme_get_setting('color.palette', $theme))) {
    foreach ($theme_palette as $color_name => $color_code) {
      $palette[$color_name] = $color_code;
    }
  }
  return $palette;
}