How to change the color of a text field in PDF?

I am making a pdf document using pdfrw. I can’t set text field color via javascript:

var textField1 = this.getField("textField1");

textField1.rect =[x1,y,x2,y2]            //working
textField1.value ='text'                 //working

textField1.textColor = color.green       //not working
textField1.fillColor = color.green       //not working

What could be the problem?