Skip to content

How to pass a color as global variable? #624

Answered by pgundlach
Cicorione asked this question in Q&A
Discussion options

You must be logged in to vote
<SetVariable variable="title-bar-color" select="blue" />
<SetVariable variable="title-bar-color" select="'blue'" />

the first line will not work, as you select the value of the element blue. The second works since you select the string "blue".

When you use background-color="$title-bar-color" you explicitly ask for the color named $title-bar-color which could be defined with

<DefineColor name="$title-bar-color" ...>

which I assume you did not do.

You need to use curly braces as described in the manual. It jumps into XPath mode and evaluates the expression, in this case it is a variable reference (getting the contents of the variable with the nametitle-bar-color).

In the case of

<Message se…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@Cicorione
Comment options

@Cicorione
Comment options

@pgundlach
Comment options

Answer selected by Cicorione
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants