var t = texture().lines().stroke('red') if(this.button.on) t= texture.heavier()
var t = texture({lines: true, heavier: this.button.on, stroke: 'red'})
var texture = new Texture({lines: true, heavier: this.button.on, stroke: 'red'});
Also, use of the "new" keyword is contentious. You can hardly pretend that it is best practice.
var t = texture().lines().stroke('red') if(this.button.on) t.heavier()