| Reference | Downloads | Github

Screen color (brightness) as a variable to select before speech in noise task begins



I am very new to PsychoPy and python in general. I am setting up a speech-in-noise experiment, where we will be recording pupil dilation via an eye tracker. We want to be able to select various screen luminance levels before each condition of the speech-noise-task. I have set up the dialog box to select the level (e.g. brightness level 1, level 2, etc.) before each trial but now I need to make those selections mean something and actually change the background color of the screen. Does anyone have any experience with this, or any suggestions on how to proceed?

Using windows 7 and PsychoPy2 v1.83.04.

Thanks in advance.


The background colour of the window can be set at creation but I seem to recall that it is not a great idea to try and manipulate it dynamically afterwards. You probably want to create an ImageStim or ShapeStim that is the size of the window, and set its colour as required. Here is some information on colour spaces:

Working out the quantitative correspondence between a given colour specification and actual physical luminance is a whole other minefield though, I think, e.g:


Thanks very much! I’ll check out the sources.