In the fading example at TikZ examples

I would like to change the "speed" at which fade occurs. In fact I would like it to be very "sharp" so that in the square examples you basically will see about half a square because it fades out so quick.

Any ideas how to achieve that? (basically I want to overlay two squares with different colors and end up seeing half a square of one color and the other half the other color but with a sort of quick fade between the two in the center(instead of the gradual fade that the default tikz setup gives)

-
I'd try using a fading (Section 20.3 of the PGF2.10 manual). You can create one from an arbitrary picture to do almost whatever you like. –  Loop Space Mar 28 '12 at 11:08

By default, there's no option for setting the transition speed between the colors of a linear shading. You can relatively easily add it, though. Here's a new style fading speed=<0..100> that allow setting the transition speed for the standard axis shading.

\documentclass{standalone}
\usepackage{tikz}
\begin{document}

\makeatletter
\tikzset{
tikz@axis@top,tikz@axis@middle,tikz@axis@bottom%
]{axis#1}{100bp}{%
color(0bp)=(tikz@axis@bottom);
color(50bp)=(tikz@axis@middle);
color(100bp)=(tikz@axis@top)
}
}
}
\makeatother

\begin{tikzpicture}[top color=blue, bottom color=yellow]

\foreach \speed [count=\count] in {0,25,...,100}{
\fill [fading speed=\speed] (\count,0) rectangle +(1,2);
\path (\count,0) +(0.5,2) node [text=white,anchor=north] {\speed};
}
\end{tikzpicture}
\end{document}

-
cool, I didn't realize you could do these types of things. –  Uiy Mar 28 '12 at 12:46
Would it be possible to modify this so it takes into account the shading angle and initial direction? I would attempt to modify it myself but I don't quite understand the text macro ;/ I'm having issues with it since it uses a fixed direction and my code uses multiple directions(shades based on an angle that changes) –  Uiy Mar 28 '12 at 13:04
You can just set shading angle=<angle> to rotate the shading. Is that what you're looking for? Otherwise, it might be best to open a new question. –  Jake Mar 28 '12 at 13:08
This doesn't give the same effect as fading angle. I am using various fading angles and I want shading to work. I'm thinking it might not be your code as it does seem to change angles but happens to be the way things work. I'll open a new question for what I really want to do instead of creating tricks. –  Uiy Mar 28 '12 at 13:11