The keyword here is depiction. And it can be correct. But it is just that, a depiction. It is using a sliver of the visible spectrum against the whole visible spectrum to calculate the temperature of the star. Now humans have used color as a descriptor for the amount of heat for eons. It is kind of an ingrained bias. So the color index does just that. Calculates that a massive start that has more mass will make more heat (10,000K) so we will call it blue because it is on the high side of the visible spectrum. Our Sun while still large but more of medium size will not be as warm (5800K) so we will call it yellow. And a small star will not have as much mass and be cooler yet (3000K) so we will call it red. The thing is put all three stars at a distance where the flux is the same as the Earth is to the Sun and all three will look white in the visible spectrum as long as all three are still in the main sequence.