How to generate gratings (Gabor patches) with two arbitrary colors

Thank you for the clarification on manipulating luminance!

And I appreciate the blog link, that’s the most concise yet thorough explanation of isoluminance I’ve come across. It seems that there are several ways to achieve isoluminance, traversing across a variety of colors spaces. But once isoluminance is achieved, the illusion (either via MM or HFP) is stable. I hope that interpretation makes sense.

And from reading related papers that use isoluminant stimuli, they don’t seem to care about spatial frequency of their stimuli (in the way that people that calibrate contrast sensitivity do), so I hope this assumption is correct and the isoluminance of the square-wave grating is generalizable to all red-green stimuli, at least to that subject – if anyone comes across this and thinks this is incorrect, please let me know.