Example 6 Given that when $x \in[0,1]$, the inequality
$$
x^{2} \cos \theta-x(1-x)+(1-x)^{2} \sin \theta>0
$$
always holds. Try to find the range of $\theta$.
(1999, National High School Mathematics Competition)
Let
$$
f(x)=x^{2} \cos \theta-x(1-x)+(1-x)^{2} \sin \theta \text {. }
$$

To ensure that $f(x)>0$ for all $x \in[0,1]$, it is sufficient that $f(x)_{\text {min }}>0$ for $x \in[0,1]$.
Notice that
$$
\begin{array}{c}
f(x)=(1+\sin \theta+\cos \theta) x^{2}- \\
(1+2 \sin \theta) x+\sin \theta \\
=(1+\sin \theta+\cos \theta) \\
{\left[x-\frac{1+2 \sin \theta}{2(1+\sin \theta+\cos \theta)}\right]^{2}+} \\
\sin \theta-\frac{(1+2 \sin \theta)^{2}}{4(1+\sin \theta+\cos \theta)} .
\end{array}
$$

Thus, we need to determine the opening direction of the quadratic function and the relative position of its axis of symmetry with respect to the closed interval $[0,1]$.
First, use the conditions to control the range of $\theta$.
Since for any $x \in[0,1]$, we always have $f(x)>0$, then $\sin \theta=f(0)>0, \cos \theta=f(1)>0$. Hence
$$
2 k \pi<\theta<2 k \pi+\frac{\pi}{2}(k \in \mathbf{Z}) .
$$

Since $f(x)>0$ for all $x \in[0,1]$, the minimum value of $f(x)$ must be greater than 0, i.e.,
$$
f(x)_{\min }=\sin \theta-\frac{(1+2 \sin \theta)^{2}}{4(1+\sin \theta+\cos \theta)}>0 \text {, }
$$

which simplifies to
$$
\begin{array}{l}
4(1+\sin \theta+\cos \theta) \sin \theta-(1+2 \sin \theta)^{2} \\
=2 \sin 2 \theta-1>0 \text {. }
\end{array}
$$

Thus, $\sin 2 \theta>\frac{1}{2}$.
Therefore, $2 m \pi+\frac{\pi}{6}<2 \theta<2 m \pi+\frac{5 \pi}{6}$, which implies
$$
m \pi+\frac{\pi}{12}<\theta<m \pi+\frac{5 \pi}{12}(m \in \mathbf{Z}) .
$$

In summary, the range of $\theta$ is
$$
2 k \pi+\frac{\pi}{12}<\theta<2 k \pi+\frac{5 \pi}{12}(k \in \mathbf{Z}) .
$$