[Resolved] Custom colour palette

Home Forums Support [Resolved] Custom colour palette

Home Forums Support Custom colour palette

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1659894
    Rachel

    Hi,

    are you implementing a custom color palette to the theme, Gutenberg and Generateblocks, too?

    I am using two code snippets now but in the customiser I am missing the
    a) transparency and
    b) if I click inside Gutenberg to change the color of a single word of a paragraph it does change the whole sentence instead of only one word.
    c) I prefer to use in posts the normal Gutenberg editor instead of Generateblocks (I use it only in pages and with the block element.

    #1660774
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    We’re working on a global color feature in GP and GB.

    What code snippets are you using, currently?

    How are you adding the color? I believe you need to use the block toolbar to color individual words – not the features in the sidebar.

    #1664056
    Rachel

    Hi,

    Thanks Tom. Really great to hear that you are working on it.

    Watched Leo’s video today with the dynamic stuff.

    Really good- I love your way of thinking.

    I am using code snippets and I posted the code in from one of your posts. I run it only in the Admin area.

    I was trying to use the generateblocks colour selection but that didn’t work so I used the Gutenberg one that works but it would be cool to use it in generateblocks…

    Thank you

    #1664898
    Tom
    Lead Developer
    Lead Developer

    Strange, it should work in GenerateBlocks, but it depends on the exact snippet. Feel free to link me to it and I’ll take a look.

    Thanks for the kind words! Lots of cool things on the way 🙂

    #1666668
    Rachel

    Hi, this is the code I have put in the snippets plugin.

    This for the customizer:

    add_filter( ‘generate_default_color_palettes’, ‘tu_custom_color_palettes’ );
    function tu_custom_color_palettes( $palettes ) {
    $palettes = array(
    ‘#666666’,
    ‘#FFFFFF’,
    ‘#000000’,
    ‘#CCABC1’,
    ‘#F2E3E3’,
    ‘#D09100’,
    );

    return $palettes;
    }

    and this one

    add_action( ‘after_setup_theme’, function() {
    add_theme_support( ‘editor-color-palette’, array(
    array(
    ‘name’ => __( ‘Dove Gray’ ),
    ‘slug’ => ‘dove gray’,
    ‘color’ => ‘#666666’,
    ),
    array(
    ‘name’ => __( ‘White’ ),
    ‘slug’ => ‘white’,
    ‘color’ => ‘#FFFFFF’,
    ),
    array(
    ‘name’ => __( ‘Lily’ ),
    ‘slug’ => ‘lily’,
    ‘color’ => ‘#CCABC1’,
    ),
    array(
    ‘name’ => __( ‘Dawn Pink’ ),
    ‘slug’ => ‘Dawn Pink’,
    ‘color’ => ‘#F2E3E3’,
    ),
    array(
    ‘name’ => __( ‘Buddha Gold’ ),
    ‘slug’ => ‘Buddha Gold’,
    ‘color’ => ‘#D09100’,
    ),
    array(
    ‘name’ => __( ‘Strikemaster’ ),
    ‘slug’ => ‘Strikemaster’,
    ‘color’ => ‘#8E6480’,
    ),
    array(
    ‘name’ => __( ‘Bermuda’ ),
    ‘slug’ => ‘Bermuda’,
    ‘color’ => ‘#7DBBC3’,
    ),
    ) );
    } );

    #1666677
    Rachel

    Oh, it works to select it but it doesnt take the color – I need to go to custom color and it is selected but I need to press return – than it works.

    #1666821
    Tom
    Lead Developer
    Lead Developer

    And that makes it work on the front-end as well?

    One thing I’m noticing is the capital letters/spaces in your slug values. Make sure to keep it lowercase with dashes instead of spaces. So Dawn Pink becomes dawn-pink.

    #1670150
    Rachel

    Thank you I just wait when it is finished in Generateblocks and Generatepress.

    Do you have a rough idea when to release it?

    Thank you.

    #1671027
    Tom
    Lead Developer
    Lead Developer

    Since you’re using this with a core paragraph block, it’s not likely something that will be fixed in GP/GB – it should just work out of the box.

    #1673226
    Rachel

    Thank you Tom

    #1674064
    Tom
    Lead Developer
    Lead Developer
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.