Same name and namespace in other branches
- 5.x modules/color/color.module \color_get_palette()
- 7.x modules/color/color.module \color_get_palette()
- 8.9.x core/modules/color/color.module \color_get_palette()
- 9 core/modules/color/color.module \color_get_palette()
Helper function to retrieve the color palette for a particular theme.
2 calls to color_get_palette()
- color_scheme_form in modules/
color/ color.module - Form callback. Returns the configuration form.
- _color_rewrite_stylesheet in modules/
color/ color.module - Rewrite the stylesheet to match the colors in the palette.
File
- modules/
color/ color.module, line 134
Code
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);
}