Use Color Field Value in Views Field Template File
In this use case, I believe inline styles are the way to go. There are methods to write a CSS file in your module or theme, for example, but since users can select, and update at any time, any color code, all situations would be very difficult or messy to manage. Inline styles are not ideal in the grand scope of things, but with multiple users, and multiple hex values reaching the millions, sometimes requirements make our choices for us. And plus, we just want to get it done.



Below assumes the view shows nodes, both fields are on the content type, and the title being styled is the node title, not the views title. This is best achieved setting the view to display content, and utilizing template files for your chosen display mode such as node--content-type--teaser.tpl.php.

node--content-type--rotating-hero.tpl.php:

&lt;section&gt;
  &lt;h1 
    title="&lt;?php print render($title); ?&gt;" 
    alt="&lt;?php print render($title); ?&gt;"
    &lt;?php if (isset($content['field_background_colour'])) : ?&gt;
      style="color: #&lt;?php print $content['field_background_colour']['#items'][0]['value']; ?&gt;;"
    &lt;?php endif; ?&gt;
  &gt;
    &lt;?php print render($title); ?&gt;
  &lt;/h1&gt;
&lt;/section&gt;


Here, each .views-row will contain an individual node display, and you can focus your javascript and CSS on those for the slider.

*multiple h1 tags on the same page need to be wrapped in a &lt;section&gt; tag, otherwise, use h2 tags.

*Templates are related to structure and usage. Views templates are for the structure and layout of content aggregation, node templates are the structure of individual entities. Wherever the field (or desired data) resides is the best place to theme template files.



Below assumes you need to style the views title itself...

will need more info about where the color field lives. If user profile, for example, you will need to load the user object to access the field value.

MYMODULE.module:

function MYMODULE_views_pre_render(&amp;$view) {
  if ($view-&gt;name == 'view_name') {
    $view-&gt;build_info['title'] = "custom title";
  }
}


template.php:

function MYTHEME_views_pre_render(&amp;$variables) {
  if (&amp;$variables['view']-&gt;name == 'view_name') {
    &amp;$variables['view']-&gt;build_info['title'] = "custom title";
  }
}