home

HTML template

This box, which probably is more usefull for webmasters than other people, let you apply colors onto a HTML sample page.

Choosing the template

List of available templates is shown. Once you have changed the current template, the preview above is updated to reflect this change.

Click the button to see the page in a full-size browser window.

Applying colors to a template

The Template box use colors that have been memorized, in the given order. Some templates only pick one color from the memory, other use two or more colors.

If memory is empty, a message is displayed under the thumbnail.

Writing a template for colordb

To do so, you need to write a CSS file, and if reuiqred, a HTML file.

The only difference between a "normal" HTML or CSS file and the templates used by colordb is the way colors are written in them: you have to use "macros" to reference a color index in the memory. Note that if the template refers to an index greater than the size of memory (number of memorized colors), the macro command will be replaced with the standard "inherit" keyword.

Of course, you can still use some "hard-coded" colors value, if you want to (example: you want the bocy background to always be white).

Once your templtae is written, mail me and I will add it as soon as possible.

Writing a CSS template

If you have planned to write only a CSS template, this one will be parsed and applied to a default HTML file, which is here: default.thml. As you can see, this HTML file is just writing sentences in some HTML div blocks. These divs are declared in a separate CSS: default.tcss. All divs are hidden by default.

It is your CSS template role to make some div blocks visible, to position them and to give them colors. See this example ex1.tcss.

Wrting a HTML template

Sometimes, the layout you have in mind is to complicated to be handled by the default.thtml file. In such a case, simply write a HTML file with the same name of your CSS template file: if colordb finds such a file, it will not use the default.thtml file.

Syntax

Each time you need to use a memorized color, write a macro as below:

MacroExampleMeaning
#colorX <td color="#color2"> Use the memorized color # X.
#colorXN div#d1 { background-color: #color1; color: #color1n; } Use white if the color X is a dark color, or black if color X is light.
This is usefull to ensure text readibility (see example on the left).
#colorXL+ th { background-color: #color3l+;}
td { background-color: #color3l++;}
Use a color which is color X + 10% of lightness.
Use pultiple plus signs ("+") to get a 20, 30 or 40% lighter color.
#colorXL- div#n1 { border-color: #color4l---;} Use a color which is color X - 10% of lightness.
Use pultiple minus signs ("-") to get a 20, 30 or 40% darker color.

Macros are not case-sensitive.

There is no limit in the number of colors youc can reference through the macros. But keep in mind that a template with more than 5 colors will probably give bad results (too much colors in a HTML page is not a good thing).

Warning !! As the template file is displayed as a thumbnail in colordb, you must not use font-family settings in your template, and any position or dimension must be set in percentage (or 1 to 3 pixels for borders, that's OK).