Colors
When providing a value for style attributes that define color, you can specify a generic color name or its RGB value.
This section describes how to specify a value for style attributes
defining colors, such as textColor
.
Syntax
{ generic-color | #rrggbb }
- generic-color is any of the predefined colors supported by the language.
- #rrggbb is a numerical color defined by a red/green/blue specification.
Usage
In most cases it is not possible to know what a potential end-user might expect
regarding the font family. Therefore, avoid using explicit font families in your
application and use only the
fontWeight
/fontStyle
/fontSize
properties. A specific font family is used only if the client cannot determine a
proper default font family for the desired platform.
The language defines a set of generic color names, interpreted by the front-end depending on the graphical capability of the workstation.
RGB notation
<Style name="Edit.mandatory">
<StyleAttribute name="textColor" value="#50AEFF" />
</Style>
Each value of the RGB color specification must be provided in hexadecimal, in the range [00-FF].
Generic color names
Use generic color names, to keep your style definitions portable across several front-end types.
Generic color name | Visual result (1) | RGB value |
---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example
<StyleAttribute name="textColor" value="blue" />
<StyleAttribute name="textColor" value="#00FF45" />