I've got a page with vocabulary: color
This color has terms like: red, green, blue.

Now I want to create a page and select the color of the page. By creating the page, I add a class to the page with the termname. So if I select blue, my page color will look like something as:
<div class="<?PHP print $term?>"><?PHP print $node->content; ?></div>

In my css I add:
DIV.blue{
background-color:blue;
}

This all works. But now I want my to change the color of my menu-item too. So I added this code to template.php:

function THEME_menu_item($link, $has_children, $menu = '', $in_active_trail = FALSE, $extra_class = NULL) {
   
  $class = ($menu ? 'expanded' : ($has_children ? 'collapsed' : 'leaf'));
  if (!empty($extra_class)) {
    $class .= ' '. $extra_class;
  }
  if ($in_active_trail) {
    $class .= ' active-trail';
  }
  return '<li class="'. $class .'">'. $link . $menu ."</li>\n";
}

But in this peace of code I can't access my terms which are linked to the page.

Can someone tell how to do this, please?