Open qjebbs opened 4 years ago
The following code throw an error of Error: image needs to be a Buffer, but:
Error: image needs to be a Buffer
null
pattern.image
So, it's I think it's a bug of the api environment.
let subText = new sketch.Text({ text: '123', parent: sketch.getSelectedDocument().pages[0].layers[0], }); subText.style = { fills: [ { enabled: false, fillType: sketch.Style.FillType.Color, pattern: { image: null } } ] }
One more thing, if a change the value of image to undefined, the error gone.
undefined
The following code throw an error of
Error: image needs to be a Buffer
, but:null
is valid topattern.image
according to api documentSo, it's I think it's a bug of the api environment.