How to set a color with a variable?

joscha.schmiedt's Avatar

joscha.schmiedt

22 Jul, 2016 09:04 AM

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

  1. Support Staff 1 Posted by Christopher Sta... on 22 Jul, 2016 01:49 PM

    Christopher Stawarz's Avatar

    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

  2. Christopher Stawarz closed this discussion on 08 Aug, 2016 05:22 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac