xai
July 18, 2020, 12:45pm
1
URL of experiment:
Description of the problem: error for defining color
i am using
grey = new util.Color([.2, .2, .2]);
this code in js to change color of text
but still giving error message that grey color not defined.
" unknown named color: grey "
in text component i tried only grey and $grey
both not working…
thanks in advance
Thank You
This method only works in code components. Are you setting it in the text component itself. If so you probably need to remove the variable definition or possibly use gray
xai
July 21, 2020, 4:53pm
3
Thanks a lot!!!
gray in component is working fine.
defining in code and .setcolor is also working.
Thanks
Here is a nice solution for changing the color of text stimuli by means of a code component:
Hi.
I am trying to use an array as the color of my text stimulus. I used my_txt.setColor(new util.Color(rgbColor, colorspace= "RGB255")) syntax. I guess I need to specify the color space differently since I got ReferenceError: colorspace is not defined.
I tested my_txt.setColor(new util.Color(rgbColor, colorspace= Color.COLOR_SPACE.RGB255)) and it throws and error too.
Any idea of how to specify the space color here?
Thanks
2 Likes