I need to create a square GratingStim that alternates between blue & green and red & green using the Coder. I couldn't figure out how to create it without using a 2x2 PNG texture. Here is a snippet of that:
std_stim = visual.GratingStim(
window,
tex='blue-green.png',
texRes=256,
units='deg',
sf=5.25,
size=2
)
dev_stim = visual.GratingStim(
window,
tex='red-green.png',
texRes=256,
units='deg',
sf=5.25,
size=2
)
That seems to work (give or take—the sf and size are so small that the bars of the stim are not always equal pixels). My problem is that I need them to be isoluminant, so I need to use the DKL space. I took the measurements with the photometer and have everything else involved with using DKL in place, but I do not know how to create a square GratingStim using any color space (DKL or RGB) to alternate between two specific colors.
I haven't come across anything in the docs that explains how to do this. Is there a way to create a square GratingStim where the bars alternate between blue & green and red & green?