A method of coating a substrate (A), said method comprising the steps of a) providing a substrate (A), said substrate (A) comprising at least a first type of chemical groups, at least a fraction of the at least first type of chemical groups is at the surface of the substrate (A), b) applying a layer (B) of a first mixture on the substrate (A) surface, said first mixture comprising a compound comprising at least a second type of chemical groups, wherein the first type of chemical groups have the ability to react with the second type of chemical groups to form a covalent bond, c) initiating a reaction to form a covalent bond (C) by reaction of the first type of chemical groups and the second type of chemical groups, wherein a layer of a reacted first mixture is formed from the first mixture excluding the second type of chemical groups which are covalently bound, d) applying a layer (D) of a second mixture on the layer of reacted first mixture, characterized in that the reacted first mixture and the second mixture are able to undergo diffusive mixing so that the concentration calculated by weight of any compound in the reacted first layer deviates at most 10% from the concentration of the same compound calculated in both the layer of the reacted first mixture and the layer of the second mixture taken together, within 1 minute after application of the layer (D) of the second mixture at 20 °C, wherein a resulting mixture of the reacted first mixture and the second mixture is able to form a coating after curing, e) curing the resulting mixture of the reacted first mixture and the second mixture to form a coating. a) providing a substrate (A), said substrate (A) comprising at least a first type of chemical groups, at least a fraction of the at least first type of chemical groups is at the surface of the substrate (A), b) applying a layer (B) of a first mixture on the substrate (A) surface, said first mixture comprising a compound comprising at least a second type of chemical groups, wherein the first type of chemical groups have the ability to react with the second type of chemical groups to form a covalent bond, c) initiating a reaction to form a covalent bond (C) by reaction of the first type of chemical groups and the second type of chemical groups, wherein a layer of a reacted first mixture is formed from the first mixture excluding the second type of chemical groups which are covalently bound, d) applying a layer (D) of a second mixture on the layer of reacted first mixture, characterized in that the reacted first mixture and the second mixture are able to undergo diffusive mixing so that the concentration calculated by weight of any compound in the reacted first layer deviates at most 10% from the concentration of the same compound calculated in both the layer of the reacted first mixture and the layer of the second mixture taken together, within 1 minute after application of the layer (D) of the second mixture at 20 °C, wherein a resulting mixture of the reacted first mixture and the second mixture is able to form a coating after curing, e) curing the resulting mixture of the reacted first mixture and the second mixture to form a coating. <EOS>