7. Six people line up, each choosing one ball from five colors: red, yellow, blue, white, and black (there are enough balls of each color). It is required that any two adjacent people either choose the same color or at least one of them chooses white. The number of ways to choose the balls that satisfy the condition is $\qquad$

将上面的文本翻译成英文，请保留源文本的换行和格式，直接输出翻译结果。
7.1093.

Consider the number of ways $f_{n}$ for $n$ people $P_{1}, P_{2}, \cdots, P_{n}$ arranged in a row to select balls according to certain rules.

Let $a_{n}$ and $b_{n}$ represent the number of ways where $P_{n}$ selects a white ball and the number of ways where $P_{n}$ does not select a white ball, respectively.

When $n \geqslant 2$, each way $P_{n}$ selects a white ball corresponds to one feasible way for $P_{1}, P_{2}, \cdots, P_{n-1}$ to select balls, so $a_{n}=f_{n-1}$.

Each way $P_{n}$ does not select a white ball can correspond to one feasible way where $P_{1}, P_{2}, \cdots, P_{n-1}$ make $P_{n-1}$ select a white ball (in this case, $P_{n}$ has four possible ball colors to choose from), or to one feasible way where $P_{1}, P_{2}, \cdots, P_{n-1}$ make $P_{n-1}$ and $P_{n}$ select balls of the same color.
$$
\begin{array}{l}
\text { Thus, } b_{n}=4 a_{n-1}+b_{n-1} \text {. } \\
\text { Therefore, } f_{n}=a_{n}+b_{n} \\
=a_{n}+\left(a_{n-1}+b_{n-1}\right)+3 a_{n-1} \\
=2 f_{n-1}+3 f_{n-2}(n \geqslant 3) .
\end{array}
$$

Given $f_{1}=5, f_{2}=5^{2}-4 \times 3=13$, we can recursively compute:
$$
f_{3}=41, f_{4}=121, f_{5}=365, f_{6}=1093 .
$$

Therefore, the answer is 1093.