The invention relates to a preparation method of a hair dye, especially to a preparation method for a botanical hair dye, and specifically relates to a preparation method for a hair dye based on a walnut green husk pigment. The preparation method comprises the following steps: striping walnut green husk, air drying in a shady place; crushing, sieving through a sieve of 70-90 meshes; adding green husk powder and acetone into a container with a solid-liquid mass ratio of 1:25-35 and an acetone concentration of 70-90%, oscillation processing the solution at a constant temperature of 40-50 DEG C for 10-14 h; centrifuging the solution for 2-4 times, filtering off impurities and collecting the supernatant; decompressing concentrating the solution at a temperature of 50-65 DEG C to obtain an ointment; and preparing the hair dye according to the following material ratios: 5-7% of the ointment, 85-87% of water, 0.5-1.5% of silicone oil, 0.5-1.5% of oil-solubility VE, 0.5-1.5% of VB, 3-5% of olive oil and 0.5-1.5% of white vaseline. The preparation method is simple, easy to operate and high in recovery rate. The prepared green husk pigment is granular, shows yellow under the developing effect of methyl red, has no escherichia coli, is suitable for exploitation of the hair dye, and helps to solve the problems that the conventional hair dye contains carcinogenesis substances and the natural hair dye is not exploited fully.