Goal: Draw a semi-circle and fill it with line-gradient color that changes according to angle. For example, with angle from θ=0 to θ=π, it is expected that the filling color shades from red to blue.
In tikz manual (https://tikz.dev/library-shadings), the shading pattern does not statisfy my need in the following aspects:
The option
shading = color wheel
seems to only applicable to a circle rather than semi-circle.The option
shading = color wheel
renders a distorted color at the origin, whileshading=color wheel white center
fills a white region at the origin.The
color whell
seems not really line-gradient.
So, is there any way to make an ideal semi-circle with line-gradient color filling by angle?
A similar example can be seen here, but some changes are needed:
It is expected to be semi-circle rather than a quadrant.
The filled color is prefered to be gradient according the angle(or its consine).
I tried the following codes, but the gradient pattern seems not quite obvious, and the origin is screwy.
\documentclass[tikz, margin=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{shadings}
\begin{document}
\begin{tikzpicture}
\clip (0, 0) -- (1, 0) arc [start angle=0, end angle=180, radius=1cm] -- cycle ;
\shade[shading=color wheel, shading angle=-60] (0, 0) circle (1cm) ;
\end{tikzpicture}
\end{document}