Skip to main content
Question

Plugin API bug: fills assignment fails when there’s a "PATTERN" fill in the array


Valery_Sibikovsky1

Hi,

Whenever one of the fills that are being assigned is a "PATTERN" it throws an error.

Assignment of an existing pattern fill:

figma.currentPage.selection[0].fills = [{
    "type": "PATTERN",
    "visible": true,
    "opacity": 1,
    "blendMode": "NORMAL",
    "sourceNodeId": "1:2",
    "tileType": "RECTANGULAR",
    "scalingFactor": 1,
    "spacing": {
        "x": 0,
        "y": 0
    },
    "horizontalAlignment": "START",
    "verticalAlignment": "START"
}]

The error:

Uncaught Error: in set_fills: Property "fills" failed validation: Invalid discriminator value. Expected 'SOLID' | 'GRADIENT_LINEAR' | 'GRADIENT_RADIAL' | 'GRADIENT_ANGULAR' | 'GRADIENT_DIAMOND' | 'IMAGE' | 'VIDEO' at [0].type     at RectangleNode.set_fills [as fills] (7607-39a655741d0aff8…min.js.br:910:62574)     at <anonymous>:1:38
set_fills@7607-39a655741d0aff8b.min.js.br:910(anonymous)@VM249:1

 

0 replies

Be the first to reply!

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings