|
Synopsis
Colors are used so frequently within the Discus Template Language that an entire page has been devoted to document the various color settings that can be extracted and used. The colors for each board are defined in the Appearance Manager. Within that interface, it is possible to define the background color, text color, link color, visited link color, active link color, font face, font size, and background image (the "static" color settings). It is also possible to define up to ten colors to be used in other situations (the "alternating" color settings).
Static colors (and fonts)
The "Discussion Board Colors/Font/Background" section of Appearance Manager allows the following colors to be defined. Indicated here are the Discus Template Language code to access each color setting as well as a description of the setting.
| Setting |
Description |
| $color->{bgcolor} |
Background Color |
| $color->{text} |
Text Color |
| $color->{link} |
Unvisited Link Color |
| $color->{vlink} |
Visited Link Color |
| $color->{alink} |
Active Link Color |
| $color->{face} |
Font Face |
| $color->{size} |
Font Size |
| $color->{image} |
Background Image URL |
| $color->{smsize} |
Mathematically defined as Font Size minus 1 |
Alternating Colors
Alternating colors were first introduced to Discus so that the template designer could cause backgrounds of table cells within topic, subtopic, and message lists to alternate. Recently, alternating colors retain this role, but they also are used to control certain backgrounds within certain skins, even in a way that they do not alternate.
Colors can be made to alternate with the @_ALTCOLOR array and the syntax to pick alternating elements from an array:
<#pick color $message->{_iteration} from @_ALTCOLOR(7,8)#>
As the code above iterates through the messages, the color will be alternating between the 7th and 8th color.
Each element of the special @_ALTCOLOR array has the following components:
| Component Name |
Description |
| number |
Alternating color number (1 - 20) |
| color |
Hex code of that alternating color |
When using "alternating" colors in such a way as they are not alternating (e.g., you always want to get the 6th "alternating" color), you can use the $color hash with the following keys:
| Setting |
Description |
| $color->{alt_1} |
1st alternating color |
| $color->{alt_2} |
2nd alternating color |
| $color->{alt_3} |
3rd alternating color |
| $color->{alt_4} |
4th alternating color |
| $color->{alt_5} |
5th alternating color |
| $color->{alt_6} |
6th alternating color |
| $color->{alt_7} |
7th alternating color |
| $color->{alt_8} |
8th alternating color |
| $color->{alt_9} |
9th alternating color |
| $color->{alt_10} |
10th alternating color |
| $color->{alt_11} |
11th alternating color |
| $color->{alt_12} |
12th alternating color |
| $color->{alt_13} |
13th alternating color |
| $color->{alt_14} |
14th alternating color |
| $color->{alt_15} |
15th alternating color |
| $color->{alt_16} |
16th alternating color |
| $color->{alt_17} |
17th alternating color |
| $color->{alt_18} |
18th alternating color |
| $color->{alt_19} |
19th alternating color |
| $color->{alt_20} |
20th alternating color |
|