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
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
Ok many thanks, it works now! I tried it first in my child theme but that didn’t work.
Hi olavo,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
Victoria
Thanks Guenni, I’ll take a look!
Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan Shannon
it’s all clear now, many thanks. Topic can be closed.
Hi olavo,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria