Why does the inside of a CPU look colored?

Solution 1:

As light is refracted from the transistors it produces the different colours, but I am sure that the marketing people tweak it quite a bit.

Add a polarising filter on the camera lens and all sorts of things are possible. a combination of all of these I think.

Solution 2:

It is not an inherent color of the chip, or at least, not of the materials. ICs are made of silicon and aluminum; silicon is usually dark metallic gray, and of course aluminum is a "white"-reflective metal.

But... Have you ever seen diffraction grating tape or sheets used as decorative items? You probably have, but maybe called it something else, like "rainbow tape". Generally it's Mylar plastic with a "silvery" reflective coating (aluminum). For diffraction tape it is then embossed with a very large number of very fine parallel lines, and in the right light it shows strong rainbow patterns. You can often find this stuff for sale in the shops that are attached to science museums and the like.

The "data" side of CDs and DVDs will show the same sorts of patterns - pressed ones much more so than "burned" ones.

Well, on a complex integrated circuit, the regular pattern of a great many very fine parallel lines acts like a diffraction grating and shows the same "rainbow" effect.

CPUs and other ICs don't always look like that though. You need the right angle of incident light, and other factors. It helps if the light is broad-spectrum white - sunlight or good ol' tungsten are best for this.