Problem with my code? Idk...help!

OS: Windows 10
PsychoPy version: v2021.2.3

**What are you trying to achieve?: I am trying to present image stimuli in my experiment. I am currently working on getting the images to present themselves (and I will get it uploaded online at some point as well). I had a version that was working and then all of a sudden it stopped working due to errors. Now, my text stimuli needs to be left aligned and the background needs to be black (not grey). For some reason, the text in my first routine does not appear and my experiment “errors out” before it runs now due to a color error.Processing: code.docx…

HRI_SoCog Experiment_lastrun.py (80.7 KB)

This is the errors that I keep getting
→ 2.7259 ERROR ‘1.0000, 1.0000, 1.0000’ is not a valid rgb color
4.0161 DEPRECATION ‘-1.0000, -1.0000, -1.0000’ is not a valid rgb color
Traceback (most recent call last):
File “I:\HIR_SoCog Experiment\HRI_SoCog Experiment_lastrun.py”, line 287, in
Informed_Consent_keys.keys =
NameError: name ‘Informed_Consent_keys’ is not defined

Experiment ended.

Having just run into the same problem, it looks like one needs to put the colour values inside square brackets, and insert a $ prior to the open bracket. For instance, using “$[-1, -1, -1]” for black rather than “-1, -1, -1” results in black (rather than invisible) text.

However, from the error message you’ve posted, I think the failure of your experiment isn’t due to the colour error, but rather due to the variable “Informed_Consent_keys” not being defined. (The colour error just means the text doesn’t show up, rather than stopping the program from running.)