Define colour transparency in relation to existing colour
Background
Using ConTeXt to develop a nice theme where users can change the colour
scheme, but still get the same "feeling" for the output, primary,
secondary, and tertiary colours are defined. For example:
\definecolor[ColourSecondary][h=9A957A]
Each colour can then be "lightened" by setting its transparency:
\definecolor[ColourSecondaryLighter][h=9A957A,a=1,t=.5]
\definecolor[ColourSecondaryLightest][h=9A957A,a=1,t=.3]
This works but is not ideal.
Problem
The ColourSecondary value of 9A957A is repeated for the lighter colours,
resulting in triplicated code.
Question
How do you create a transparent variation on an existing colour?
For example:
\definecolor[ColourSecondaryLighter][h=\tohex{ColourSecondary},a=1,t=.5]
The following did not work:
\definecolor[ColourSecondaryLighter][1.0(ColourSecondary),a=1,t=.5]
References
http://wiki.contextgarden.net/Command/definecolor
No comments:
Post a Comment