How to change theme colors based on time of day for Adaptivetheme (or other theme that allows user-selectable colors)? I'm using a custom subtheme of the Pixture Reloaded subtheme of Adaptivetheme.  I want to change the theme colors based on the hour of the day.  (I want a "day" theme and a "night" theme.)

I know that I can do this with the Themekey module, which allows you to specify rules for which theme to use.  You can make a rule based on the time of day and have two different themes, but then I will have to maintain two entirely separate themes.  Since all I want to change is the colors, taking this approach would be a maintenance nightmare.

Pixture Reloaded uses the Color module to allow users to select the colors, so I don't understand how to easily override it.

One thing I noticed is that there are a number of pre-defined color schemes.  For my purposes, it would be sufficient to have a way to automatically use one pre-defined scheme during the day, and another at night.

How can I do this without creating (and maintaining) a copy of my original theme?
Place the following code into your theme's template.php file.

/**
* Implements template_preprocess_html().
*/
function YOUR_THEME_preprocess_html(&amp;$vars) {
  // Day / night background theming.
  $hour = date('G');
  $theme = 'day';
  if ($hour &lt;= 6) {
    $theme = 'night';
  }
  elseif ($hour &gt;= 6 &amp;&amp; $hour &lt;= 18) {
    $theme = 'day';
  }
  elseif ($hour &gt;= 18) {
    $theme = 'night';
  }
  $vars['classes_array'][] = $theme;
}


Now your &lt;body&gt; tag should have the CSS class 'day' or 'night' depending on the current server time.

An example CSS code would look like:

body.day {
  background: #fff;
  color: #000;
}
body.night {
  background: #000;
  color: #fff;
}


for more info check this tutorial.