Hi,
I’m using the colour picker on a site that I’m building and it occurred to me that it would be nice feature to be able to save some of the colours as favourites as I’m using them over and over. If you have a look at the colour picker in Beaver Builder it has this feature.
Hi @jayokey
You should be able to do it by using this code:
function my_acf_collor_pallete_script() {
?>
<script type="text/javascript">
(function($){
acf.add_filter('color_picker_args', function( args, $field ){
// do something to args
args.palettes = ['#5ee8bf', '#2f353e', '#f55e4f']
// return
return args;
});
})(jQuery);
</script>
<?php
}
add_action('acf/input/admin_footer', 'my_acf_collor_pallete_script');
This page should give you more idea about it: https://www.advancedcustomfields.com/resources/adding-custom-javascript-fields/.
I hope this helps 🙂
Thanks James, I’ve put your suggestion into action and it works well.