I granted it via ADB using the command line listed, but the other method with app might work too. If you don't have ADB, It's very easy to install by just downloading the right sdk for your OS, and you run the included ADB binary via command line while your phone is plugged in via USB, and USB debugging is enabled (which is an android developer setting).
Set your Android accessibility color correction type to grayscale if you don't have that already. The below Tasker action simply toggles it off and on.
Tasker config is-
Configure a Shake Left-Right event trigger (I recommend sensitivity 'Very Low' and Duration 'Long' to avoid accidental triggers)
Set the Collision Handling on the task gear/settings to "Abort Existing Task", so that you can extend the color lifetime by shaking the phone again.
Of course, once you have this action in Tasker, you can use any trigger to turn it on or off, like opening a particular app, turning it on when you are only at home or away, etc.
Works pretty well for me, there is one slight issue where some type of android display layout refresh occurs when the color toggle happens, which sometimes refreshes the interface you are on in a slightly annoying way. I tolerate it, it's ok, maybe setting a longer wait period would make this occur less often.
If these steps don't work / too confusing, try using the really great accessibility gesture support setting mentioned in a reply, instead or in addition: https://news.ycombinator.com/item?id=40462366
FYI John Dalton was a scientist who pioneered color blindness research among many other fields, so his name is everywhere in color correction settings apparently.