Bird
Raised Fist0
Figmabi_tool~10 mins

Opacity control in Figma - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the opacity of a layer to 50%.

Figma
layer.opacity = [1]
Drag options to blanks, or click blank then click option'
A50
B0.5
C1
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 50 instead of 0.5 for opacity value
Using 1 which means fully opaque
Using 0 which means fully transparent
2fill in blank
medium

Complete the code to reduce the opacity of a selected object by 20%.

Figma
selected.opacity = selected.opacity - [1]
Drag options to blanks, or click blank then click option'
A2
B20
C0.2
D0.02
Attempts:
3 left
💡 Hint
Common Mistakes
Subtracting 20 instead of 0.2
Using 2 which is out of opacity range
Using 0.02 which is only 2%
3fill in blank
hard

Fix the error in the code to set opacity to 75%.

Figma
frame.opacity = [1]
Drag options to blanks, or click blank then click option'
A7.5
B75
C75%
D0.75
Attempts:
3 left
💡 Hint
Common Mistakes
Using 75 or 75% which are invalid
Using 7.5 which is out of range
4fill in blank
hard

Fill both blanks to set the opacity of a rectangle to 30% and then increase it by 10%.

Figma
rectangle.opacity = [1]
rectangle.opacity = rectangle.opacity + [2]
Drag options to blanks, or click blank then click option'
A0.3
B0.1
C0.2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0.2 instead of 0.1 for increase
Using 1 which would set opacity to fully opaque
5fill in blank
hard

Fill all three blanks to create a function that sets opacity to a given percent, ensuring the value stays between 0 and 1.

Figma
function setOpacity(obj, percent) {
  let value = percent / [1];
  obj.opacity = Math.min(Math.max(value, [2]), [3]);
}
Drag options to blanks, or click blank then click option'
A100
B0
C1
D255
Attempts:
3 left
💡 Hint
Common Mistakes
Using 255 instead of 100 for percent conversion
Not clamping opacity between 0 and 1

Practice

(1/5)
1. What does setting the opacity to 0% do to an object in Figma?
easy
A. Makes the object completely invisible
B. Makes the object fully visible
C. Changes the object color to white
D. Locks the object from editing

Solution

  1. Step 1: Understand opacity scale

    Opacity ranges from 0% (invisible) to 100% (fully visible).
  2. Step 2: Apply opacity 0%

    Setting opacity to 0% means the object is fully transparent and cannot be seen.
  3. Final Answer:

    Makes the object completely invisible -> Option A
  4. Quick Check:

    Opacity 0% = Invisible [OK]
Hint: Opacity 0% means fully invisible, 100% fully visible [OK]
Common Mistakes:
  • Confusing opacity 0% with white color
  • Thinking opacity 0% locks the object
  • Assuming opacity 0% makes object semi-transparent
2. Which of the following is the correct way to set opacity to 50% in Figma's Properties panel?
easy
A. Type 500 in the opacity input box
B. Type 0.5 in the opacity input box
C. Type 5 in the opacity input box
D. Type 50 in the opacity input box

Solution

  1. Step 1: Check opacity input format

    Figma opacity is set as a percentage from 0 to 100, not decimal.
  2. Step 2: Identify correct input for 50%

    Typing 50 means 50% opacity, which is half transparent.
  3. Final Answer:

    Type 50 in the opacity input box -> Option D
  4. Quick Check:

    Opacity input uses percentage numbers [OK]
Hint: Use whole numbers 0-100 for opacity, not decimals [OK]
Common Mistakes:
  • Entering decimal like 0.5 instead of 50
  • Typing values greater than 100
  • Confusing opacity with fill color values
3. If a rectangle has opacity set to 30% and a blue fill color, what will be the visual effect on a white background?
medium
A. The rectangle appears white
B. The rectangle appears as a light blue transparent shape
C. The rectangle appears fully blue and opaque
D. The rectangle is invisible

Solution

  1. Step 1: Understand opacity effect on color

    Opacity reduces the color's visibility by making it transparent.
  2. Step 2: Apply 30% opacity on blue fill

    Blue color will show but faintly, blending with white background.
  3. Final Answer:

    The rectangle appears as a light blue transparent shape -> Option B
  4. Quick Check:

    Low opacity = lighter, transparent color [OK]
Hint: Lower opacity means color looks lighter and see-through [OK]
Common Mistakes:
  • Thinking opacity changes the fill color itself
  • Assuming 30% opacity means mostly opaque
  • Confusing opacity with brightness
4. You set an object's opacity to 120% in Figma. What will happen?
medium
A. Figma will show an error and not accept the value
B. The object will become invisible
C. The opacity will be capped at 100%
D. The object will become semi-transparent

Solution

  1. Step 1: Check valid opacity range

    Opacity values must be between 0% and 100% in Figma.
  2. Step 2: Understand input behavior for out-of-range values

    Figma caps values above 100% to 100%, no error shown.
  3. Final Answer:

    The opacity will be capped at 100% -> Option C
  4. Quick Check:

    Opacity max is 100%, inputs above are capped [OK]
Hint: Opacity cannot exceed 100%, values above are limited [OK]
Common Mistakes:
  • Expecting an error message for invalid opacity
  • Thinking opacity above 100% makes object invisible
  • Assuming opacity can be more than fully visible
5. You want to highlight a button by making the background color fully visible but the icon on top semi-transparent at 40% opacity. How should you set the opacity values?
hard
A. Set button background opacity to 100% and icon opacity to 40%
B. Set button background opacity to 40% and icon opacity to 100%
C. Set both button background and icon opacity to 40%
D. Set both button background and icon opacity to 100%

Solution

  1. Step 1: Identify desired visibility for button background

    The background should be fully visible, so opacity must be 100%.
  2. Step 2: Identify desired visibility for icon

    The icon should be semi-transparent, so set opacity to 40%.
  3. Final Answer:

    Set button background opacity to 100% and icon opacity to 40% -> Option A
  4. Quick Check:

    Background fully visible + icon semi-transparent = Set button background opacity to 100% and icon opacity to 40% [OK]
Hint: Full opacity for background, lower opacity for overlay elements [OK]
Common Mistakes:
  • Setting background opacity too low and losing visibility
  • Making icon fully opaque when semi-transparent is needed
  • Confusing which element needs which opacity