Home › Forums › Feature Requests › Color Picker values › Reply To: Color Picker values
Here’s a quick workaround plugin:
https://gist.github.com/squarecandy/036290389ba97434b17ab959a0ce9aef
Throw that in your plugins folder, activate, and then use sqcdy_acf_rgb('my_color_field')
in place of the_field('my_color_field')
or sqcdy_get_acf_rgb('my_color_field')
in place of get_field('my_color_field')
.
It just outputs RRR,GGG,BBB so you can use the output in your css like this:
color: rgb(<?php sqcdy_acf_rgb('my_color_field'); ?>);
or with rgba like this:
color: rgba(<?php sqcdy_acf_rgb('my_color_field'); ?>,0.5);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.