In the Liebermann test for phenols, the blue or green colour produced is due to the formation of
When phenol is treated with NaNO2 crystals dissolved in concentrated H2SO4, it provides a deep green or blue colour which changes to red on dilution with water. Adding more alkali NaOH or KOH restores original green or blue colour. This reaction is called Liebermann's nitroso reaction.
The red coloured Indophenol, when treated with more alkali, gives blue or blue-green colouration - indicative of the salt of the shown Indophenol molecule.