Stroop task error: word.setColor(color, colorSpace='rgb') AttributeError: 'str' object has no attribute 'setColor'

win 10

trying to create a stroop task , I gave the codes ‘r’, ‘g’, ‘b’ for red ,green and blue in the response section as i should . defined a conditions list for color, words and answer. this is the message i got :
word.setColor(color, colorSpace=‘rgb’)
AttributeError: ‘str’ object has no attribute ‘setColor’
what is an str object?
what am i supposed to do?

I think the issue is that you are trying to set the colour of the string, rather than the object in which the string is contained. Try adding .setColor to the name of the text box object, rather than the string