Color of text in online program

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

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:

2 Likes