4. Let $f(x)$ represent the smaller of $-x+6$ and $-2 x^{2}+4 x+6$, the maximum value of the function $f(x)$ is $\qquad$ .
4. 6. In the same coordinate system, draw the graphs of the functions $y=-x+6$ and $y=-2 x^{2}+4 x+6$, and the solution can be obtained.