color_get_palette

  1. drupal
    1. drupal6
    2. drupal7
Versionen
drupal6 color_get_palette($theme, $default = false)
drupal7 color_get_palette($theme, $default = FALSE)

Helper function to retrieve the color palette for a particular theme.

▾ 3 functions call color_get_palette()

color_scheme_form in modules/color/color.module
Form callback. Returns the configuration form.
color_scheme_form_submit in modules/color/color.module
Submit handler for color change form.
_color_rewrite_stylesheet in modules/color/color.module
Rewrite the stylesheet to match the colors in the palette.

Code

modules/color/color.module, line 134

<?php
function color_get_palette($theme, $default = false) {
  // Fetch and expand default palette
  $fields = array('base', 'link', 'top', 'bottom', 'text');
  $info = color_get_info($theme);
  $keys = array_keys($info['schemes']);
  foreach (explode(',', array_shift($keys)) as $k => $scheme) {
    $palette[$fields[$k]] = $scheme;
  }

  // Load variable
  return $default ? $palette : variable_get('color_' . $theme . '_palette', $palette);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen