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.
Asked
Active
Viewed 161 times
0
![](../../users/profiles/48213.webp)
phantom-99w
- 101
- 4
1 Answers
0
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.
![](../../users/profiles/35064.webp)
Josh koenig
- 101