using advanced custom field to control css hover color

style.php does not have access to the WP variables, loop and so on. If you’d want to do that, you would need to repeat at least some of the queries used on your main page, and you would also add a new request for the browser, as you’d have the separate file.

I would rather generate a class based on the colors, use it for the headings, then print the CSS in the same page, in a <style> markup:

<?php
$colors = array(
  0 =>  the_field('taxonomy_color', 'magazine_'. $tax_term->term_id),
  'hover' =>  the_field('taxonomy_hover', 'magazine_'. $tax_term->term_id),
  'active' =>  the_field('taxonomy_active', 'magazine_'. $tax_term->term_id),
);
//get an unique class name with the allowed syntax - eg: _0000FF_000099_FF0000
$class="_" + str_replace('#','', implode('_', $colors));
//create the CSS code 
$style="";
foreach ( $colors as $key => $color ) {
  $style .= 'a.' . $class;
  if ( $key > 0 ) { $style .= ':' . $key; }
  $style .= '{ color: ' . $color . ';}';
}
?>
<h4 class="<?= $class ?>">Hello</h4>
...
<!-- before the end of the page -->
<style><?= $style ?></style>

This code would work for named colors or hexa values. If you’d also like to use RGB and or RGBA, you should also eliminate / replace the following characters when computing the class name: “(“, “)”, “.” and “,”. If you’re using a loop, you should also store each $style value in an array and print all the styles at the end, in a single <style>...</style> markup.