I learned that when $PbO$ is hot, it is orange. When $PbO$ is cold, it is yellow. I know this's called thermochromism. But how do that happen? Is it because the ions inside doing something?
In the case of lead oxide and many other inorganic thermochromic materials, the color change is a result of a phase change that slightly alters the distance separating the inorganic ions.
In ordered materials, the energy levels present in atoms and molecules are replaced by energy bands. Said differently, in materials with extended order there are so many energy levels clustered around one another at a certain energy point and separated from one another by such small amounts of energy, that the distinct energy levels of the molecules "fuzz" out into a band. Instead of a highest occupied and lowest unoccupied molecular orbital (HOMO and LUMO), a valence band and a conduction band results.
Just as the HOMO-LUMO separation will determine where in the energy spectrum an organic molecule will absorb light, the energy separation between the valence band and the conduction band (called the band gap) will determine where a material with extended order will absorb light.
In the case of lead oxide and other crystalline materials, slight changes in the crystal structure (phase change) that can be brought about by heating or cooling the material, will change the size of the band gap. This change in the energy separation between the valence band and conduction band will result in a change in the optical (and electronic) properties of the material. If the change in optical absorption occurs in the visible region, then the thermochromic properties of the material are apparent to the eye.
Here is a link to a nice paper that starts simply, but then goes into greater depth, on this subject.