The invention relates to a method of releasing chemical compounds. The method includes distributing containers encapsulating a chemical compound over hair, said containers being configured to release the chemical compound upon reaching a transition temperature, and heating the hair to a predetermined temperature equal to or higher than the transition temperature. The heating of the hair enables heat transfer from the hair to one or more of the containers that are in proximity of the hair,whereby the one or more containers reach the transition temperature and release the chemical compound. In this manner, only those containers that are in close proximity to the hair can be heated up to their transition temperature and release the compound. Consequently, the compound is only released locally where the hair is present, while other skin areas where the hair is not present are protected against the potentially negative side effects of the compound.