Unfortunately, your image isn’t working.
The link you supplied was to go from RGB to HSV
I don’t know if you can go direct from HEX to HSV, you may need to convert your HEX to RGB then to HSV – may not be 100% accurate though as going from RGB to HSV.
So you either need to adjust your output setting of the ACF field to the RGBA array (as per my example) OR you need to add the additional step.
<?php $rgb_hex = get_field('colour'); list($R, $G, $B) = sscanf($rgb_hex, "#%02x%02x%02x"); $hsv = RGBtoHSV($R, $G, $B); echo '<pre>'; print_r($hsv); echo '</pre>'; echo '<p>Red: '.$hsv.' Green: '.$hsv.' Blue: '.$hsv.'</p>';
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!