Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chris-castillo-dev/ffb03868491d83c71ed09f9817768d70 to your computer and use it in GitHub Desktop.
Save chris-castillo-dev/ffb03868491d83c71ed09f9817768d70 to your computer and use it in GitHub Desktop.
/**
* Populate Gutenberg Color Palette Colors
*/
function pro_populate_gutenberg_color_palette() {
// Disable Custom Colors
add_theme_support( 'disable-custom-colors' );
// Editor Color Palette
add_theme_support( 'editor-color-palette', array(
array(
'name' => __( 'Brand 1', 'pro-theme-1' ),
'slug' => 'pro-theme-brand-1',
'color' => '#153840',
),
array(
'name' => __( 'Brand 2', 'pro-theme-1' ),
'slug' => 'pro-theme-brand-2',
'color' => '#c4e1de',
),
array(
'name' => __( 'Brand 3', 'pro-theme-1' ),
'slug' => 'pro-theme-brand-3',
'color' => '#bb8b3b',
),
array(
'name' => __( 'Light 1', 'pro-theme-1' ),
'slug' => 'pro-theme-light-1',
'color' => '#c4e1de',
),
array(
'name' => __( 'Light 2', 'pro-theme-1' ),
'slug' => 'pro-theme-light-2',
'color' => '#e1f0ee',
)
) );
}
add_action( 'after_setup_theme', 'pro_populate_gutenberg_color_palette' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment