Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1277716

    Hi,

    I saw a 2019 thread about this with an announcement of new functionality to come. Is there already news about a custom color palette in the colorpicker? Or is there an option to make this happen with a plugin or in php?

    I saw this file on GitHub: avf_colorpicker_colors.php but am not sure where to put this.

    <?php
    /**
     * Add or modify your own predefined palette colors to the popup colorpicker in ALB elements
     * 
     * @since 4.5.7.2
     * @param array $colors
     * @return array
     */
    function custom_colorpicker_colors( array $colors )
    {
    	/**
    	 * These are the default colors - change or extend them as needed
    	 * Keep in mind that the more colors you use the smaller the boxes will be
    	 */
    	$colors = array( '#000000', '#ffffff', '#007db7', '#f0c15b', '#eeee22', '#83a846', '#7bb0e7', '#745f7e' );
    	
    	return $colors;
    }
    
    	
    add_filter( 'avf_colorpicker_colors', 'custom_colorpicker_colors', 10, 1 );
    

    Thanks!

    Olav

    #1278321

    Hey olavo,

    You can put this code in your child theme functions.php file.

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1278670

    Ok many thanks, it works now! I tried it first in my child theme but that didn’t work.

    #1278781

    Hi olavo,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1278805
    #1278845

    Thanks Guenni, I’ll take a look!

    #1278928

    Hi,

    Did you need additional help with this topic or shall we close?

    Best regards,
    Jordan Shannon

    #1278998

    it’s all clear now, many thanks. Topic can be closed.

    #1279185

    Hi olavo,

    Great :)

    We are closing the thread.

    If you need further assistance please let us know in a new one.

    Best regards,
    Victoria

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Custom colorpicker colours’ is closed to new replies.