Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to set the fill color of a shape to red in Figma.
Figma
node.fills = [{ type: 'SOLID', color: { r: 1, g: [1], b: 0 } }]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 255 instead of 0-1 scale
Setting green to 1 which makes yellow
✗ Incorrect
The green (g) value should be 0 to get pure red color in RGB.
2fill in blank
mediumComplete the code to create a text node with color blue in Figma.
Figma
const text = figma.createText();
text.fills = [{ type: 'SOLID', color: { r: 0, g: 0, b: [1] } }]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 255 instead of 1
Setting blue to 0 which results in black
✗ Incorrect
Blue color has blue channel set to 1, red and green are 0.
3fill in blank
hardFix the error in the code to set a rectangle's fill color to green in Figma.
Figma
const rect = figma.createRectangle();
rect.fills = [{ type: 'SOLID', color: { r: 0, g: [1], b: 0 } }]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 255 which is out of range
Using negative values
✗ Incorrect
Green color uses green channel = 1 in Figma's 0-1 scale.
4fill in blank
hardFill both blanks to create a semi-transparent red fill in Figma.
Figma
node.fills = [{ type: 'SOLID', color: { r: [1], g: 0, b: 0 }, opacity: [2] }]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting opacity to 0 which makes it invisible
Using green or blue channel instead of red
✗ Incorrect
Red color uses r=1, and opacity 0.5 makes it semi-transparent.
5fill in blank
hardFill all three blanks to create a yellow fill with 80% opacity in Figma.
Figma
node.fills = [{ type: 'SOLID', color: { r: [1], g: [2], b: [3] }, opacity: 0.8 }]; Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Setting blue to 1 which makes white
Confusing opacity with color channels
✗ Incorrect
Yellow is red=1, green=1, blue=0. Opacity is set to 0.8 outside the blanks.