"fix a color or colors in the substance of by immersion in coloring matter held in solution," Middle English deien, Old English deagian "to dye," from the source of dye (n.). Spelling distinction between dye and die was not firm till 19c. "Johnson in his Dictionary, spelled them both die, while Addison, his near contemporary, spelled both dye" [Barnhart]. Related: dyed. For dyed in the wool (or grain) see wool (n.).
Others are reading
<a href="https://www.etymonline.com/word/dyeing">Etymology of dyeing by etymonline</a>
Harper, D. (n.d.). Etymology of dyeing. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/dyeing