Matching a Color by Value
Syntax: <color color="value" value="legend-label"
label="legend-label"/>
Example: <color color="#c0d9d9"
value="Java"/>
Use: Defines a color to use when the component matches some
criterion.
A color is used for a component if value of the
<color>
attribute matches the value at the XPath specified
in the use
attribute of the parent <colors>
.
For example, consider the <colors>
element in the following
code snippet:
<colors match="@ts" label="Technology Streams">
<color color="grey " value="Unknown"/>
<color color="#c0d9d9" value="Java"/>
<color color="#00ffff" value="Kernel"/>
...
For the element <component … ts="Kernel" …>
, the color
#00ffff
(cyan) is used. If a component contains a ts
with no value, or a value which does not appear in the list, it will be grey.
The <color>
attribute accepts any valid CSS color.
This includes color names such as blue
, hex values such as
#00ffff
, and RGB triples such as rgb(255,106,126)
. If
a <color>
does not match anything, it will not be shown in
the legend.