New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When called for an image component, setColor does not update image color. #29
Comments
The implementation in psychopy is essentially to multiply the image pixel color by the RGB of the designated color. We now do this with a shader but it used to be using textures combined with glColor |
Have you checked that this isn't related to writing 'red' instead of new util.Color([1, -1, -1]); ? |
Yes it fails both ways. For named colors, you can use any of those listed as a named color in PsychoJS Line 493 in 8276bd7
|
Hello, I am wondering whether this has been resolved. I'm having the same issue but for a text component. I built my experiment in Builder, and it works fine in psychopy but does not work when I run it on Pavlovia in psychojs. The behavior I am aiming to achieve is that on each trial when a participant presses the 'f' key, a text component on the screen will turn blue, indicating that it was the selected option, and then green if it is the correct answer or red if incorrect. And the same if the 'j' key is pressed for a different text component. I know my logic that I added through a code component is correct because it works when I run it in builder. When I run it on Pavlovia though, it changes the colors correctly for the first trial only, and then after it is stuck on the behavior from the first trial. I know my logic in js is working too because the behavior of the "correct"/"incorrect" text feedback is correct, and it uses the same logic. Plus, I printed the color and where I was in the if/else conditionals to the consol and could see that the logic was properly handling the key input and changing the colors accordingly. It seems that the call to I am using Psychopy 2020.2.2 on Windows 10. |
Hi, I'm wondering if this has been resolved or anyone found a way around it. I'm trying to recolour an empty white image by setting a new colour. Works brilliantly locally, fails online. Unfortunately using a Polygon is not an option as I need a mask on the image. |
In PsychoPy, you can change the color of your image component on every repeat or every frame using the
Color
parameter in the Builder image component. However, the code that is used for the JavaScript is not working - where "image" is the name of the image component:Example of current PsychoJS behaviour
https://pavlovia.org/run/dvbridges/imagefade/html/
The text was updated successfully, but these errors were encountered: