3.3. Creating New Tapestry Color Styles
Tapestry allows you to choose from 20 different color styles. But if you want a different color scheme, we've designed Tapestry so that it would be relatively simple to create new styles.
We say 'relatively' simple because it's not trivial. If you are well versed in Adobe Fireworks, if you're comfortable editing CSS and PHP code, and if you have a good understanding of Drupal, then you should have few problems creating a new color scheme.
But if editing CSS code is not your cup of tea, we would be happy to create a custom version of Tapestry that matches your color scheme, your logo, etc. for a very reasonable fee. Contact us and let us know what you want.
This section offers a brief summary of the steps necessary to create a new Tapestry color style. A more complete breakdown of every step required is well beyond the scope of this handbook.
Warning - What follows is a sloppily-worded description of a complex process. We will gloss over important details, neglect to mention necessary steps, describe things in gramatically incorrect run-on sentences, and otherwise fail to shed enough light on the process.
Editing the Source Fireworks File
The images used by Tapestry are generated from a source PNG file created with Adobe Fireworks. This source PNG file is available for download. If you have a copy of Fireworks, you can edit the source file, modify the existing color styles or create a new one, and export new images for use with the theme.
Each of Tapestry's available color styles is implemented as a separate frame in Fireworks. To create a new color style, we usually duplicate an existing frame, rename this duplicate with the name of our new style, and then modify the new frame until we get the results we're seeking.
The web slice layer in the soruce file relies on the elements of the page to remain in their existing locations. This means that, for the most part, you don't want to move, resize, or otherwise modify the size or shape of elements of the page. What you can modify is the colors and the gradients used by elemetns of the page.
You can export the image slices to any folder, but you will eventually need to place them in a sub-folder of the tapestry images folder. Tapestry will use this folder name to reference your color style, so don't use spaces or special characters in the name.
We export the slices for each frame separetely. Select the web slice layer (and thus all of its contents), select the Export menu option, check the Selected slices only box, check the Current frame only box box, check the Current page only box, uncheck the Include areas without slices box, and click Save.
Creating the CSS for Your New Color Style
Like most Drupal themes, the Tapestry theme includes a CSS file called style.css that is located in the theme's root folder. However, Tapestry isolates all of the CSS code that is related to colors and background images to separate CSS style sheets. For each of the available color schemes, there is one CSS style sheet in the css folder.
The easiest way to create the CSS file for a new color scheme is to duplicate an existing style's CSS file, rename the file to reflect your new style's name, and modify this new CSS file. The file name should exactly match the name of the images sub-folder that contains the images for this color style.
Most Tapestry color schemes are composed of five major colors, plus a default text color (usually #1D2326), and sometimes White (#FFFFFF). A very effective way to 'get started' customizing your new style's CSS file is to use your editor's search-and-replace feature. Here's how it works.
From the CSS file that you duplicated, determine the RGB values for the five major colors of the style. If you duplicated the file gerberdaisy.css, you'll find that the five major colors are #FFFFFF, #EABE10, #8B0000, #9A8C80, and #000000. Using your editor's search-and-replace function, change all of the occurances of an existing color to one of your new scheme's colors. Repeat for the remaining colors.
Just to make things more difficult, you will notice that we often employ the CSS shorthand notation for standard RGB colors, like using #FFF instead of the more complete #FFFFFF. You'll have to take this into account as you're modifying the file.
You'll also want to change the path names used to reference the image files. So if you started by duplicating the allstar.css file and you're creating a color style called bigshot, be sure to replace all occurances of images/allstar with images/bigshot.
But wait. It's never that simple. While this process will get the desired colors into your new color style, there will no doubt be several 'problem areas' where you will need to modify text colors, link colors, and/or background colors for specific elements. Maybe you'll only need to change a few things, or maybe you'll need to change everything.
To perform this process effectively, you almost have to use the Firebug plugin for Firefox. It also helps to have a page similar to our Block Themes Page so that you can look at every element of the theme.
Integrating Your New Color Style Into Tapestry
Once you've exported the images for your new color style from Fireworks and created a new CSS file, you'll want to integrate it into the Tapestry framework. You will need to put all of the files in the appropriate locations, and you will need to modify one of the Tapestry theme files.
You sould place the image files that you exported from Fireworks in a subfolder of the images folder. The name of this folder will need to match other elements that we will set up next.
You should place the CSS file for your new color style in the css folder. The file name should match the folder name containing the images, and the extension should be css.
In the theme's root folder, find the file settings.php and open it with your favorite source code editor. Locate the table of current color style names near the top of this file. It should look something like this:
$form['tapestry_style'] = array(
'#type' => 'select',
'#title' => t('Style'),
'#default_value' => $settings['tapestry_style'],
'#options' => array(
'allstar' => t('All Star'),
'bluecollar' => t('Bluecollar'),
'bogart' => t('Bogart'),
'bizcasual' => t('Business Casual'),
'cactusbloom' => t('Cactus Bloom'),
'dustypetrol' => t('Dusty Petrol'),
'firenze' => t('Firenze'),
'fusion' => t('Fusion'),
'gerberdaisy' => t('Gerber Daisy'),
'haarlemmod' => t('Haarlem Modern'),
'kalamata' => t('Kalamata Cream'),
'kobenhavn' => t('Kobenhavn Classic'),
'antoinette' => t('Marie Antoinette'),
'modhome' => t('Modern Home'),
'modoffice' => t('Modern Office'),
'orientexpress' => t('Orient Express'),
'woodworks' => t('Scandinavian Woodworks'),
'techoffice' => t('Tech Office'),
'watermelon' => t('Watermelon'),
),
);
Add a new entry to the options array to reflect your new color style. The array index name must match both the name of the CSS file and the name of the subfolder in the images folder containing your images. The first entry in the existing table, for example, references a color style called allstar that is described by the file /tapestry/css/allstar.css and uses the images located in /tapestry/images/allstar.
The array value is the string that will be displayed as an option in the Style selection control on the theme settings page. Use this value to provide a human readable name for your color style. Save your changes.
Once you've made these changes, copy your new color style's CSS file, image folder, and the modified settings file into the appropriate places of your Drupal installation. Point your browser to the Tapestry theme settings page and select your new color style from the list.
Frequently Asked Questions
Q: Can I use PhotoShop instead of Fireworks?
A: No.
- Printer-friendly version
- Login to post comments
