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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | 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. // Getting a mutable override-free object because this function is only used // in forms. Color configuration is used to write CSS to the file system // making configuration overrides pointless. return \Drupal::configFactory()->getEditable( 'color.theme.' . $theme )->get( 'palette' ) ? : $palette ; } |
Please login to continue.