Read field value and pass it to section style atributes only for node page I have a color field in content type -> page fields. And i want to read the values of this field and pass this value as a background color(bootstrap subtheme) to element  for main content ( - from page,tlp.php). And only for node type -> page.

In my template.php i tried to use function theme_preprocess_page. My code:

function theme_preprocess_page(&amp;$vars) {

    if (isset($vars['node'])) {

        $vars['theme_hook_suggestions'][] = 'page__' . $vars['node']-&gt;type . 'page';

        // check the node type and specific field in not empty  
        if (($vars['node']-&gt;type = 'page') &amp;&amp; (!empty($content['field_color']['#items'][0]['value']))) {

            //read the value of color field
            $bg_color = $content['field_color']['#items'][0]['rgb'];            

        }
    }
}


but i dont know how to pass the value of color field ($content['field_color']) to section style attributes. Should i use $vars['attributes_array']['style'] ? and how to pass it to section element style.

Help please.
$color = preg_replace("/#/i", "", $bg_color);  
$vars['classes_array'][] = $color;
 $vars['style'] = "style='background-color:$bg_color'";