How can I programatically change the color of node title in views results? I want to change the color of the node titles from a view (fields on table).
My first ides was to alter the title and add a span with inline css.

function views_titles_views_pre_render(&amp;$view) {
if ($view-&gt;name == 'documents' &amp;&amp; $view-&gt;current_display == 'page') {
    $span_open  = '&lt;span style="color: green !important;"&gt;';
    $span_close = '&lt;/span&gt;';
    $view-&gt;style_plugin-&gt;render_fields($view-&gt;result);
    foreach ($view-&gt;style_plugin-&gt;rendered_fields as $index =&gt; &amp;$rendered_result) {
      // Add HTML markup icon on rendered title field
      $rendered_result['title'] = $span_open . $rendered_result['title'].$span_close;
    }
  }
} 


Although my attempt was a success, I managed to alter the title the css rule did not alter the color of the a tag. I figured out that I should go deeper into the title. As far I can tel the dpm of the views_pre_render does not show more options. 

I have experience with drupal site building, but I am not in any way a php developer.

Can someone help me figure this out?

ps: I know there other more easy ways to achieve that but I want to do it with a module.
An easier (and more maintainable) way to achieve this would be to set a class in your span, instead of hardcoding the style. Something like the following:

$span_open = '&lt;span class="my-title"&gt;"';


You can then add a CSS file to your module, so that you can better specify the color, also overriding the a tag. For instance:

.my-title, .my-title a {
  color: green;
}


For more details about adding CSS to your module, see https://api.drupal.org/api/drupal/includes!common.inc/function/drupal_add_css/7.x