[Resolved] Feature request: Add commonly used colours to Colour Palette

Home Forums Support [Resolved] Feature request: Add commonly used colours to Colour Palette

Home Forums Support Feature request: Add commonly used colours to Colour Palette

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1410155
    Robin

    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.

    #1410261
    David
    Staff
    Customer Support

    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 );
    #1410742
    Robin

    Superb. Thank you.

    #1410865
    David
    Staff
    Customer Support

    You’re welcome

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.