Set color in online experiments

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

@Omidrezaa, try:

newCol = new util.Color([100, 10, 1], util.Color.COLOR_SPACE.RGB255);
my_txt.color = newCol;
2 Likes