They actually use cholesterols ( the same as what is in your arteries) as the fill. they have a polarising front like a LCD, and the cholesterol s are different types, so that as they hit a certain narrow temperature range the optical twisting that they do of polarised light ( from the front filter) is 45 degrees. the back reflector then reflects, it goes through another 45 degree shift then it can go out and you can see the back reflector and the markings. At higher or lower temps there is either too much or too little phase shift, so it remains black. The colours come from fringing as the polarisation approaches the 90 degree point. Totally passive, absolutely no moving parts and reversible.
the other variant more commonly used in engineering is a max indicating type, which has small black coloured wax dots inside a carrier, so that as the wax melts it is wicked away in a surrounding reservoir and exposes a coloured backing that shows the top temperature reached. Once use only, but quite good as a log of overheating or max temp in say a heatsink during operation, where you either cannot or do not want or can use a data logger.