How to customize the colour palette for ACF’s colour picker field

Ever found yourself wishing you could define an exact colour palette for ACF’s colour picker field?

Good news! You totally can.

Using the JavaScript API built right into Advanced Custom Fields we can use a very small snippet of code to specify exactly which colours appear in the palette of suggested colours.

Now, in this example, I’m just dropping this into the admin as an inline script. This works perfectly fine but you may consider adding this to a JavaScript file and enqueuing it.

One last thing…

If you liked this article, I'd be incredibly grateful if you tweeted about it.

Also, I don't send emails often but when I do, I try to fill them full of useful goodies. If you like code snippets & dev tips, join my mailing list. There's no catch but I'll probably want to tell you about any new plugins & tools I build.