I'm creating a new CV using moderncv at the moment. But I'm modifying the package to get a (at least in my opinion) better fitting result.
I'm looking for a way to make the section heading with a color gradient. Below is an example for how it looks at the moment. I would like to have a gradient from the left sight of the bar to the end of the last word.
The main part of the section heading layout is defined in "moderncvstyleclassic.sty" which I'm using:
\RenewDocumentCommand{\section}{sm}{%
\par\addvspace{2.5ex}%
\phantomsection{}% reset the anchor for hyperrefs
\addcontentsline{toc}{section}{#2}%
\parbox[t]{\hintscolumnwidth}{\strut\raggedleft\raisebox{\baseletterheight}{\color{color1}\rule{\hintscolumnwidth}{0.95ex}}}%
\hspace{\separatorcolumnwidth}%
\parbox[t]{\maincolumnwidth}{\strut\sectionstyle{#2}}%
\par\nobreak\addvspace{1ex}\@afterheading}% to avoid a pagebreak after the heading
with the following renewcommands included:
\renewcommand*{\sectionfont}{\Large\mdseries\upshape}
\renewcommand*{\sectionstyle}[1]{{\sectionfont\textcolor{color1}{#1}}}
I already found a way to write text with a color gradient. But I couldn't combine it with a bar to the left of the text (as in the picture) and the same gradient stretching across both the bar on the left and the text on the right.
This is how I found to to normal color gradient sections:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{fadings,patterns}
\begin{document}
\newsavebox{\tempbox}
\newcommand\tikzsection[1]{%
\begin{tikzfadingfrompicture}[name=tikzsection]
\node [text=white] {\normalfont \Large \bfseries #1};
\end{tikzfadingfrompicture}
\begin{lrbox}{\tempbox}%
\begin{tikzpicture}
\node [text=white,inner sep=0pt,outer sep=0pt] (textnode) {\normalfont \Large \bfseries #1};
\shade[path fading=tikzsection,fit fading=false,left color=blue,right color=black]
(textnode.south west) rectangle (textnode.north east);
\end{tikzpicture}%
\end{lrbox}
% Now we use the fading in another picture:
\section{\usebox\tempbox{}}%
}
\tikzsection{First section}
Some text
\tikzsection{Second section}
Some text
\end{document}
Now I need a way to combine this with a bar to the left of the text and to include this in my moderncv documentclass (but I guess this is the least problematic thing).