If the probability density function of a continuous random variable \(X\) is given by
\[
f(x)=
\begin{cases}
(x-2)a, & 2 \le x \le 4 \\
(8-x)a, & 4<x \le 8 \\
0, & \text{otherwise}
\end{cases}
\]
where \(a\) is a constant, then the value of \(a\) is: