Site logo

Archived topic

Feature request: Add commonly used colours to Colour Palette

3 replies · Started by Robin on August 19, 2020

Viewing posts 1–4 of 4

There are certain colours that are used often on my site. It would save a lot of time if those colours were added to the colour palette. That way I would not have to choose a custom colour and then copy paste from somewhere else.

Hi there,

this article explains how to change your default customizer colors.

https://docs.generatepress.com/article/generate_default_color_palettes/

And WP provides this filter to set colors in the Block Editor:

add_action( 'after_setup_theme', function() {
    add_theme_support(
        'editor-color-palette',
        array(
            array(
                'name'  => __( 'Scuro', 'castiglioni' ),
                'slug'  => 'dark',
                'color' => '#382c33',
            ),
            array(
                'name'  => __( 'Chiaro', 'castiglioni' ),
                'slug'  => 'light',
                'color' => '#eeeeee',
            ),
        )
    );
}, 50 );

Superb. Thank you.

You're welcome

This archived topic is closed to new replies.