For each 'theme' you can have a different template(layout) and CSS(coloring and formatting). If you're talking about a certain code being active only when someone uses a specific theme, you can use a query to identify users with that theme.
PHP Code:
$result = runquery("SELECT * FROM ".$GLOBALS[prefix]."users WHERE username='".$loggedinname."' ");
$row = mysql_fetch_array($result);
if($row['theme'] == "THEMENAME"){
// Enable block of coding. Otherwise skip and do nothing.
}