Colour of the stimuli
I am implementing Stroop task. Therefore I need to consider a special color for the stimuli ( only for choice 1). Therefore, I have the excel file as follow:
choice1 choice2 choice 3 color_choice1
Red Blue Red BLUE
Green blue Red RED
. . . .
I have the part of code as below:
t = expyriment.design.Trial()
stim1 = expyriment.stimuli.TextLine(text=trial[0], position=(0,200), text_size=32, text_colour=trial[3])
stim2 = expyriment.stimuli.TextLine(text=trial[1], position=(-230,-230), text_size=32)
stim3 = expyriment.stimuli.TextLine(text=trial[2], position=(230,-230), text_size=32)
canvas = expyriment.stimuli.Canvas(size=(600, 600))
I expected as trial[3]="BLUE", it prints stim1 as Red with blue color. But it does not work. Do you have any comment please, how to fix it?
Comments
Hi Juliette,
the colour needs to be specified in RGB terms (e.g.
[255, 0, 0]for red). To simplify this, we provide constants for common colours inexpyriment.misc.constants(e.g.expyriment.misc.constants.C_REDfor red).So in your particular case, something like this might work: