Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am using a Drupal theme which makes use of the colour picker. When I select a new colour scheme, a directory gets creates in MyDrupalSite/sites/default/files/color/ThemeName-RandomNumer. Using Opera's developer console, I can see that these files (the generated images and CSS) are used to render the website (if CSS caching is switched off, of course). However, I have no idea where Drupal is told to look in that directory for the CSS: it doesn't seem to be in a config file and I have no idea where something like that might be stored in the DB. I would also like to know where the colours for a "custom" configuration are stored: I spent a large chunk of last night trying to figure that out, but to no avail. Are they somehow encoded into the "RandomNumber"? So, if someone could enlighten me, I would be much obliged.

share|improve this question

1 Answer 1

You'll find that the color form on your theme saves the locations of the files as variables at the end of its save operation:

http://api.drupal.org/api/function/color_scheme_form_submit/6

  // Maintain list of files.
  variable_set('color_'. $theme .'_stylesheets', $css);
  variable_set('color_'. $theme .'_files', $paths['files']);

These values are then picked up by your color-aware theme. For instance, the Drupal 6 default theme (Garland) has the following in it's phptemplate_preprocess_page():

  // Hook into color.module
  if (module_exists('color')) {
    _color_page_alter($vars);
  }

This will add the CSS files to the header.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.