# Coloring

Coloring of your HTML code is highly customizable. You can choose the colors you want for HTML tags, attributes, strings, JavaScript keywords, CSS keywords, and JavaScript and CSS comments.

The coloring in HTML mode is a little bit more complex than Alpha is designed for. Alpha was originally designed to color programming code. HTML documents contains both code and ordinary text and Alpha can't tell which words are code and which are ordinary text, when it colors your documents. Therefore the coloring will not always be perfect.

In the submenu Config -> Redefine Colors there are seven extra colors color_9 ... color_15. You can use these colors to define your own favorite colors for your HTML documents. By default these seven colors are undefined, but as soon as you give them a value they appear in the coloring preference dialog box, where you can choose the colors you wants for the keywords.

By default the coloring of HTML tags is like this:

<IMG SRC="fig.gif">

Tags are colored blue, attributes magenta and strings green. For the coloring of the attributes to work the attribute values must be put inside quotes. If an attribute is written WIDTH=246 Alpha thinks WIDTH=246 is one single word and therefore doesn't find the word WIDTH= which it is supposed to color. To reduce this problem there is a function Quote all attributes in the submenu Editing of the HTML Utilities menu. This functions goes through your document and put quotes around all attributes.

## Coloring preferences dialog box

The coloring can be customized in the coloring preferences dialog box, which you find in the submenu Preferences of the HTML menu. At the top of this dialog box there is a popup menu, where you can choose between Simple coloring and Complex coloring.

When simple coloring is selected the tags are colored all blue:

<IMG SRC="fig.gif">

This can be a better choice on lowend machines with slow graphics.

When complex coloring is chosen there are a number of options to customize the coloring.

Color of HTML tags
The color of the HTML tags. The default is blue.
Color of attributes
The color of the HTML attributes. The default is magenta.
Color of strings
The color of everything between quotes. The default is green.
Always color immediately when typing
When this option is chosen the tags are always colored immediately when you simply type them into the document. The disadvantage of this option is that it colors more words in the ordinary text - provided you write in English. This coloring option also does not look as nice as the other one.
Coloring of best quality
This option gives the nicest looking coloring of the code. The only disadvantage is that the code is not colored as you type. Type control-L to redraw the window to overcome this problem.
Color JavaScript keywords
If checked, keywords and comments in JavaScript will be colored. These keywords also include the event handlers. By default JavaScript keywords are not colored. Coloring of JavaScript keywords is not possible if 'simple coloring' is used.
Color of JavaScript keywords
The color of keywords in JavaScript. Applies only if you choose to color JavaScript keywords. The default is magenta.
Color CSS keywords
If checked, keywords and comments in CSS will be colored. By default CSS keywords are not colored. Coloring of CSS keywords is not possible if 'simple coloring' is on.
Color of CSS keywords
The color of keywords in CSS. Applies only if you choose to color CSS keywords. The default is cyan.
Color of JavaScript and CSS comments
The color of comments in JavaScript and CSS. Applies only if you choose to color JavaScript or CSS keywords. The default is red.

You can also customize the coloring in CSS and JavaScript modes. See the pages documenting these modes.

Previous page Next page