The pattern of alternating blue and golden stripes displayed by adult zebrafish is composed of three kinds of pigment cells: black melanophores, yellow xanthophores, and silvery-blue iridophores. We analyzed the dynamics of xanthophores during stripe morphogenesis in vivo with long-term time-lapse imaging. Larval xanthophores start to proliferate at the onset of metamorphosis and give rise to adult xanthophores covering the flank before the arrival of stem-cell-derived iridophores and melanophores. Xanthophores compact to densely cover the iridophores forming the interstripe, and they acquire a loose stellate shape over the melanophores in the stripes. Thus, xanthophores, attracted by iridophores and repelling melanophores, sharpen and color the pattern. Variations on these cell behaviors may contribute to the generation of color pattern diversity in fish.