-
AuthorPosts
-
February 4, 2021 at 2:39 pm #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
February 6, 2021 at 5:57 pm #1278321Hey olavo,
You can put this code in your child theme functions.php file.
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 8, 2021 at 3:00 pm #1278670Ok many thanks, it works now! I tried it first in my child theme but that didn’t work.
February 8, 2021 at 8:09 pm #1278781Hi olavo,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 8, 2021 at 8:45 pm #1278805February 8, 2021 at 10:15 pm #1278845Thanks Guenni, I’ll take a look!
February 9, 2021 at 6:39 am #1278928Hi,
Did you need additional help with this topic or shall we close?
Best regards,
Jordan ShannonFebruary 9, 2021 at 10:49 am #1278998it’s all clear now, many thanks. Topic can be closed.
February 9, 2021 at 6:29 pm #1279185Hi olavo,
Great :)
We are closing the thread.
If you need further assistance please let us know in a new one.
Best regards,
Victoria -
AuthorPosts
- The topic ‘Custom colorpicker colours’ is closed to new replies.
