Here’s an explanation of how the liquid crystals change color with temperature:
“Some liquid crystals are capable of displaying different colors at different temperatures. This change is dependent on selective reflection of certain wavelengths by the crystallic structure of the material, as it changes between the low-temperature crystallic phase, through anisotropic chiral or twisted nematic phase, to the high-temperature isotropic liquid phase. Only the nematic mesophase has thermochromic properties; this restricts the effective temperature range of the material.
The twisted nematic phase has the molecules oriented in layers with regularly changing orientation, which gives them periodic spacing. The light passing the crystal undergoes Bragg diffraction on these layers, and the wavelength with the greatest constructive interference is reflected back, which is perceived as a spectral color. A change in the crystal temperature can result in a change of spacing between the layers and therefore in the reflected wavelength. The color of the thermochromic liquid crystal can therefore continuously range from non-reflective (black) through the spectral colors to black again, depending on the temperature. Typically, the high temperature state will reflect blue-violet, while the low-temperature state will reflect red-orange. Since blue is a shorter wavelength than red, this indicates that the distance of layer spacing is reduced by heating through the liquid-crystal state.” (source)
The liquid crystal is not a part of the glass. It’s in a layer under the glass. The appearance of the color filling the glass is an optical effect.