Difference between revisions of "Command/defineprocesscolor"
< Command
Jump to navigation
Jump to search
Line 24: | Line 24: | ||
<cd:examples><cd:example title="Example of getting a transparent version of an existing color"><context source="yes"> | <cd:examples><cd:example title="Example of getting a transparent version of an existing color"><context source="yes"> | ||
\setupbodyfont[palatino,20pt] | \setupbodyfont[palatino,20pt] | ||
− | \definecolor[ | + | |
− | \defineprocesscolor[ | + | \definecolor [myyellow] [r=1,g=1.,b=0.] |
− | + | \defineprocesscolor [mytrspyellowA] [myyellow] [a=1,t=.5] | |
− | + | \definecolor [mytrspyellowB] [\colorcomponents{myyellow},a=1,t=.5] | |
− | + | ||
+ | \framed[background=color,backgroundcolor=darkblue,foregroundcolor=yellow]{yellow} | ||
+ | |||
+ | \framed[background=color,backgroundcolor=darkblue,foregroundcolor=mytrspyellowA]{Transparent yellow A} | ||
+ | |||
+ | \framed[background=color,backgroundcolor=darkblue,foregroundcolor=mytrspyellowB]{Transparent yellow B} | ||
</context></cd:example></cd:examples> | </context></cd:example></cd:examples> | ||
<cd:notes></cd:notes> | <cd:notes></cd:notes> |
Latest revision as of 10:19, 8 May 2024
Contents
\defineprocesscolor
Summary
The command \defineprocesscolor allows to define a color by modifying an existing color.
Settings
\defineprocesscolor[...][...][...=...,...] | |
[...] | name |
[...] | color |
...=...,... | inherits from \definecolor |
Description
Examples
Example of getting a transparent version of an existing color
\setupbodyfont[palatino,20pt] \definecolor [myyellow] [r=1,g=1.,b=0.] \defineprocesscolor [mytrspyellowA] [myyellow] [a=1,t=.5] \definecolor [mytrspyellowB] [\colorcomponents{myyellow},a=1,t=.5] \framed[background=color,backgroundcolor=darkblue,foregroundcolor=yellow]{yellow} \framed[background=color,backgroundcolor=darkblue,foregroundcolor=mytrspyellowA]{Transparent yellow A} \framed[background=color,backgroundcolor=darkblue,foregroundcolor=mytrspyellowB]{Transparent yellow B}