We study SU(3) Yang-Mills theory in (2 + 1) dimensions based on networks of Wilson lines. With the help of the q deformation, networks respect the (discretized) SU(3) gauge symmetry as a quantum group, i.e., SU(3)k, and may enable implementations of SU(3) Yang-Mills theory in quantum and classical algorithms by referring to those of the stringnet model. As a demonstration, we perform a mean-field computation of the groundstate of SU(3)k Yang-Mills theory, which is in good agreement with the conventional Monte Carlo simulation by taking sufficiently large k. The variational ansatz of the mean-field computation can be represented by the tensor networks called infinite projected entangled pair states. The success of the mean-field computation indicates that the essential features of Yang-Mills theory are well described by tensor networks, so that they may be useful in numerical simulations of Yang-Mills theory.