This should work in both Cycles and Eevee: InvisibleInk.blend (839.2 KB)
SecretColor = TriggerColor
offset = DetectRange
BaseColor = PaperColor
Adjust the light color to see the ink
With any light color outside of the DetectRange, the ink is not visible:
Of course there is transition, the closer the light color to the TriggerColor, the more visible the ink is, and vice versa.