psychopy.org | Reference | Downloads | Github

Errors appear when upload to pavolovia : Unknown name color

URL of experiment:
https://run.pavlovia.org/qyk/ap_train_phase/?__pilotToken=8f14e45fceea167a5a36dedd4bea2543&__oauthToken=ddc5a674687d0a6302e8da43befde5b8cc66ab2db44fde350c32542f9ebb0645

experiment JS:

Description of the problem:
I designed a transparent rectangle with white lines as a cue when subjects select one of the stimuli on the screen. As the image below.

It works offline. But when I uploaded to pavlovia, some errors appeared.
“Unkonw name color”
But I have not set any color as 0.000,0.000,0.000. As the code in gitlab above. And I don’t know what is happening?

I saw my code is locked. So I posted some lines here.

JS:

resp_rect = new visual.Rect ({
win: psychoJS.window, name: ‘resp_rect’, units : ‘height’,
width: [0.6, 0.6][0], height: [0.6, 0.6][1],
ori: 0.0, pos: [0, 0],
lineWidth: 15.0, lineColor: new util.Color(‘white’),
fillColor: new util.Color(undefined),
opacity: undefined, depth: -4, interpolate: true,
});

resp_rect.setFillColor(new util.Color(‘none’));

Hi There,

What version of PsychoPy is this in?

Thanks!
Becca

The version of PsychoPy is 2021.2.0.

I think I found the bug. The Builder mode of Psychopy can recognize the ‘none’ as Fill Color. The rectangle with a ‘none’ color will be transparent. But It doesn’t seem to work for the JavaScript version of Psychopy. I change the fill color to white in .JS file and the experiment would be work. A white rectangle will replace the transparent rectangle which I expected.

Now, I use a transparent rectangle image(.png format, and set transparency=100%) to achieve the function I expected.

Thank you for your reply! I am still happy to know how to implement the functions inside Pavlovia. Or just don’t have the corresponding function yet.

The version of PsychoPy is 2021.2.0.

I think I found the bug. The Builder mode of Psychopy can recognize the ‘none’ as Fill Color. The rectangle with a ‘none’ color will be transparent. But It doesn’t seem to work for the JavaScript version of Psychopy. I change the fill color to white in .JS file and the experiment would be work. A white rectangle will replace the transparent rectangle which I expected.

Now, I use a transparent rectangle image(.png format, and set transparency=100%) to achieve the function I expected.

Thank you for your reply! I am still happy to know how to implement the functions inside Pavlovia. Or just don’t have the corresponding function yet.

In my crib sheet it says

Don’t Use fill colour $None
https://github.com/psychopy/psychojs/issues/72

Do Fill with background colour and place above anything that should appear inside it. Alternatively, add polygon.setFillColor(undefined) to Begin Routine

However, this is for polygons rather than images.

Thank you. I will try for it.