How to set a color with a variable?

Hi

I’m trying to change the color of the fixation point once the monkey starts fixating. However, if I try to set the color of the fixation_point stimulus to a variable, I always get

00:22:59: ERROR: Failed to create object.
Extended information:
reason: Invalid color string: fp_color
object_type: stimulus/fixation_point
ref_id: idm331356721344
component: fixation_point
parser_context: mw_create

I have tried string and list types for the fp_color variable.

Is it possible to set the color with a variable?

Best,
Joscha

Hi Joscha,

You need a separate variable for each color component. For example:

color="fp_color_red, fp_color_green, fp_color_blue"

If you want to change the color without dequeueing and re-queueing the fixation point, you’ll need to live-queue the stimulus (with live_queue_stimulus) and then invoke update_stimulus_display when fixation begins (to force the stimulus to redraw itself).

Cheers,
Chris