Complete the code to add an inner shadow effect in Figma.
frame.effects = [{ type: '[1]', color: { r: 0, g: 0, b: 0, a: 0.5 }, offset: { x: 0, y: 2 }, radius: 4, spread: 0 }]The correct effect type for an inner shadow in Figma is INNER_SHADOW.
Complete the code to set the shadow offset to 5 pixels right and 3 pixels down.
frame.effects = [{ type: 'INNER_SHADOW', offset: { x: [1], y: [2] }, color: { r: 0, g: 0, b: 0, a: 0.3 }, radius: 6 }]The offset x should be 5 (right) and y should be 3 (down) to position the inner shadow correctly.
Fix the error in the code to correctly apply an inner shadow with 10 radius.
frame.effects = [{ type: 'INNER_SHADOW', radius: [1], color: { r: 0, g: 0, b: 0, a: 0.4 }, offset: { x: 0, y: 0 } }]The radius value must be a number without quotes. Using 10 sets the shadow blur radius correctly.
Fill both blanks to create an inner shadow with 50% opacity and a spread of 2.
frame.effects = [{ type: 'INNER_SHADOW', color: { r: 0, g: 0, b: 0, a: [1] }, spread: [2], offset: { x: 1, y: 1 }, radius: 5 }]Opacity is 0.5 for 50%, and spread is set to 2 for the shadow spread.
Fill all three blanks to define an inner shadow with red color, 0.3 opacity, and offset 4 pixels left and 2 pixels up.
frame.effects = [{ type: 'INNER_SHADOW', color: { r: [1], g: [2], b: [3], a: 0.3 }, offset: { x: -4, y: -2 }, radius: 7 }]Red color is full red (1), no green (0), no blue (0) in normalized RGB values.