psychopy.org | Reference | Downloads | Github

Controlling GratingStim colors

Hello,

When creating a gabor patch, how do I change the color of every other bar? The following line produces red bars with every other being light blue. A blue patch yields blue and yellow bars.

gabor = visual.GratingStim(win, tex='sin', mask='gauss', units="deg",size=(4,4), sf=(2,2), color="red")

Could someone explain to me why this is, and if there is a way to control both colors rather than just the one?

Cheers,
Steve

The colors are designed to average to the mean grey of the screen. Otherwise your color would alter the overall luminance and chromaticity of the patch, which vision scientists don’t like.

You can create arbitrary colors by creating custom textures though:
https://groups.google.com/forum/#!topic/psychopy-users/WQfw2PKUHg4

1 Like