How to change color of the background: Yes, I did try tools, screen

OS Win10
PsychoPy version 2021.1.2
Standard Standalone? (y/n) Y
What are you trying to achieve?:
I’m building a word-by-word self paced reading task. Followed by comprehension Qs the answers of which has to be typed (used editable textbox). I want to change the color of the SPR in this flow. Only.


What did you try to make it work?:
I searched in the discourse and found this:

so I clicked on the tools, screen,
snip2
and tried playing with numbers, like -1, -1, -1. It did change the color to a black background with a white-colored text but for the whole project. What I wanted to change was the background color of the SPR to white with a black text. oh and I tried this:
snip
This was very confusing :expressionless: happy-go-luckily, I was changing colors and then there was no ok to save the changes!
What specifically went wrong when you tried that?:
Moreover, I asked a friend who had changed colors for her experiment and she told me to insert polygons! Crazy, but I tried that too. I inserted a white rectangle Pos 2, 2; It did change the background color of the SPR to white but the text was also white. So it was like a blank page.

I know there must be a better way.
I appreciate any help in advance :tulip:

1 Like

Do you mean that you want to change the background just for one routine? If so then you can add a Code component with win.fillColor = "white" in Begin Routine and win.fillColor = "grey" in End Routine, as win is the name PsychoPy gives to the window.

Hi. yes exactly. Thank you for the reply

I did what you said, nothing happened. no change of color.

Ah my mistake, I was thinking in terms of polygons - for window it’s just win.color not win.fillColor. You may also want to add win.clear() and win.flip() after it in the Begin Routine tab to make sure it applies.

1 Like

Thank youuu! works perfectly now.

ps: the

code didn’t work by the way. But the flip one did. Just a note for later.

1 Like

Dear @TParsons,
hi
My question is in reference what we discussed earlier about color. Today, I pushed my experiment to Pavlovia and I receive this error:

  • ReferenceError: win is not defined

I assume it’s related to color, but I don’t know how to solve it. I’ll appreciate any helpful comment of yours.

1 Like

As of 2023, fillColor is no longer used - now you need to use

win.color = 'black'
win.flip()