TextStim won't appear when I use the color picker

OS : macOS Catalina 10.15.7
PsychoPy version : v2021.2.3
Standard Standalone? (y/n) If not then what?:y
What are you trying to achieve?: I tried to use the color picker for a visual.TextStim because I didn’t like the default red and green colors. I selected normalized rgb colors [1,0,0] and [0,1,0], and they would be inserted into the foreground color property as 1.000,0.000,0.000 and 0.000,1.000,0.000. When I ran my experiment with these settings the text with these colors would never appear and I never got an error.

What did you try to make it work?: I tried using the default green from the color picker instead of changing the rgb values myself and that didn’t change anything.
I was able to get around this problem by setting the text colors back to red and green in the foreground color property and then adding a code block to the beginning of the routine to change the color. These were the lines I used:
text_go.setColor([0,1,0], colorSpace=‘rgb’) and
text_nogo.setColor([1,0,0], colorSpace=‘rgb’)

Did the text not appear at all, or was it just in the wrong colour? Normalised RGB is from 0 to 1, while non-normalised RGB is from -1 to 1, so that’s probably where the discrepancy is coming from.

If you set the colour as a hex string or as a name (the names in the colour picker are all valid) then it’s the same regardless of colour space. You can also do:
$colors.Color(value, space) to set it in a particular space regardless of the colour space of the stimulus.

The text did not appear at all. When I used the color picker and clicked the insert button to insert the color into the foreground color property I made sure that if I selected the normalized rgb color that the values were between 0 and 1. When I inserted the values they appeared in the property box as 0.000, 1.000, 0.000.

I think you’re confusing the color space of the component with the output color space option in the color picker; the colour space of the component is what it will interpret the color in. So if rgb is selected, values will need to be between -1 and 1. The output color space of the colour picker is what colour space it inserts the value as - so if the color space of the object is rgb, then the output color space of the colour picker needs to be non-normalised RGB, otherwise the colour picker is supplying a value in a different space than the component is interpreting it in.

I see, this makes sense. So, in the color picker, I select the color I want and make sure the output value is in the PsychoPy RBG color space with values from -1 to 1:


Then I click insert, and it inserts the color into the foreground color property with the values in the correct range:

I accept this change, disable my color code section, generate the .py file and check that the values in the code match the values in the property menu, save my experiment, and run it, but still the text does not appear.

Since the color space property in the property menu is a drop down menu and rgb entry doesn’t specify which rgb space it represents, I tried again with the output color space of the color picker as the normalized rgb (which I don’t expect to work because this is what I did before):


and the values are in the correct range:

and the text still does not appear.

I try again using the 8-bit rgb range:


and the values are in the correct range:

and still nothing.
Am I still missing something that’s right in front of me? Is my thought process going in the wrong direction? What should I try now?
Also I apologize for not putting all of this in one comment. As a new user I am only allowed to insert 2 media attachments in a single post.

I think there might be a bug here.

Try enclosing the numbers you see with $, e.g. $[0, 255. 0]

However, I’ve only tried this with the normal PsychoPy -1 to 1 colour space.

I did try using brackets originally and it gave me a syntax error.

Both with and without the dollar?

Actually no, I didn’t think to put a dollar sign in front of it but that worked. So, now I can get rid of the extra code block. But, I still think there is a small bug with the color picker since the inserted values don’t work unless you add $[ ] around it. Thank you @wakecarter and @TParsons for your time!