1

Hello Ladies and Gentlemen,

I want to have the "font color" of a (short) text set to a color gradient.

I already found a solution here and here and that solution also at the tikz manual on page 361.

But this solution allows only a "simple" gradient where it is possible to specify a maximum of three colors and also only on specific positions (top, bottom, left, right, middle). I have a "advanced" gradient which I would like to set to the font. Advanced means for example more than three colors or shift positions of colors (for example shift the middle position from 50% to 60%) The gradients I'm having are already finished:

% colors only for demonstration purpose
\pgfdeclarehorizontalshading{my_gradient_a}{2cm}{color(0cm)=(red);color(1.08cm)=(blue);color(1.8cm)=(green)} 
\pgfdeclarehorizontalshading{my_gradient_b}{2cm}{color(0cm)=(red);color(0.6cm)=(orange);color(1.2cm)=(yellow);color(1.8cm)=(green)}

I also found already out that it is possible to "convert" a shading to a fading with

\pgfdeclarefading{my_fade}{
\pgfuseshading{my_gradient_a}
}

But now I'm stuck and don't know how to apply the "advanced" gradient to the existing solution.

0 Answers0