Complete the code to add a drop shadow effect with default settings.
layer.effects = [[1]]The drop shadow effect in Figma is set using an effect object with type 'DROP_SHADOW'. This includes visibility, color, offset, and blur radius.
Complete the code to set the drop shadow color to semi-transparent red.
layer.effects = [{ type: 'DROP_SHADOW', visible: true, color: { r: [1], g: 0, b: 0, a: 0.5 }, offset: { x: 0, y: 4 }, radius: 4 }]The red channel value ranges from 0 to 1. To make the shadow red, set r to 1.
Fix the error in the code to correctly apply a drop shadow with offset x=5 and y=5.
layer.effects = [{ type: 'DROP_SHADOW', visible: true, color: { r: 0, g: 0, b: 0, a: 0.3 }, offset: { x: [1], y: 5 }, radius: 10 }]The offset values must be numbers, not strings. Use 5 without quotes for x offset.
Fill both blanks to create a drop shadow with offset x=3 and y=6.
layer.effects = [{ type: 'DROP_SHADOW', visible: true, color: { r: 0, g: 0, b: 0, a: 0.4 }, offset: { x: [1], y: [2] }, radius: 8 }]The offset x and y values are set to 3 and 6 respectively to position the shadow correctly.
Fill all three blanks to create a drop shadow with radius 12, offset x=7, and alpha transparency 0.25.
layer.effects = [{ type: 'DROP_SHADOW', visible: true, color: { r: 0, g: 0, b: 0, a: [1] }, offset: { x: [2], y: 0 }, radius: [3] }]The alpha transparency is 0.25 for subtle shadow, offset x is 7 for horizontal shift, and radius 12 for blur size.