Changing Polygon Colour (with colour codes!) At Every Trial

Hi There,

Task is being run on Pavlovia.

I have a POLYGON in my psychopy builder that I have placed under an IMAGE-component. I want each IMAGE (‘blueprint_im’) to be linked with a different POLYGONE COLOR (e.g., #D2B48C). I tried looping through my IMAGES, and giving distinct colour names (‘green’, ‘blue’, ‘red’), and that worked fine.

If, however, I change my ‘colour’ column (in my .csv file) to a colour code (e.g., #D2B48C, OR in rgb format [[0.639, 0.435, 0.220]], OR in PsychoPy format [[0.8195, 0.7175, 0.61]]) it stops working (and I was hoping to use more specific colours).

IN SUMMARY:

  • I load my .csv file in my loop, which contains my routine with the image and polygon components.
  • My image component calls on my $blueprint_im column (which contains a filepath to a.png file). This works fine.
  • For my polygon, under the ‘Appearance’ tab, I have Fill color and Border color call on the column $color_code. I have tried using RGB values, and Psychopy values, to no avail. If I try ‘red’ ‘green’ ‘black’ ‘blue’ in my .csv file column, then this works fine. Furthermore, I have tried adding, and removing square brackets (" [ ] ") from my RGB and/or PsychoPy colour values in the .csv file, but this has not worked either.

How can I make this work?

When you say not working, what effect are you seeing? Is there an error message, or is the colour just not changing?

It would be helpful if you could upload a minimal reproducible example :slight_smile: