Bird
Raised Fist0
SASSmarkup~20 mins

Adjust-hue for color rotation in SASS - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Hue Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What does the adjust-hue function do in Sass?
Choose the best description of what adjust-hue does to a color in Sass.
AIt rotates the color's hue angle by a specified number of degrees on the color wheel.
BIt changes the brightness of the color by a given percentage.
CIt changes the saturation of the color by a given percentage.
DIt converts the color to grayscale.
Attempts:
2 left
💡 Hint
Think about how colors are represented on a wheel and what rotating the hue means.
📝 Syntax
intermediate
2:00remaining
What is the output color of this Sass code?
Given the Sass code below, what is the resulting color in hex format?
$base-color: #ff0000;
$result: adjust-hue($base-color, 120deg);
SASS
$base-color: #ff0000;
$result: adjust-hue($base-color, 120deg);
A#0000ff
B#ffff00
C#ff00ff
D#00ff00
Attempts:
2 left
💡 Hint
Red rotated by 120 degrees on the color wheel becomes which primary color?
❓ rendering
advanced
2:00remaining
Which Sass code snippet produces a blue color by rotating red's hue?
You want to create a blue color by rotating the hue of red (#ff0000). Which code snippet correctly does this?
A$color: adjust-hue(#ff0000, 60deg);
B$color: adjust-hue(#ff0000, 120deg);
C$color: adjust-hue(#ff0000, 240deg);
D$color: adjust-hue(#ff0000, -120deg);
Attempts:
2 left
💡 Hint
Blue is 240 degrees away from red on the hue wheel.
❓ selector
advanced
1:30remaining
Which CSS selector targets elements with a background color adjusted by adjust-hue in Sass?
Given this Sass code, which CSS selector will match the elements styled with the adjusted hue background?
.btn {
  background-color: adjust-hue(#ff0000, 180deg);
}
A.btn:hover
B.btn
C#btn
Dbutton.btn
Attempts:
2 left
💡 Hint
Look at the class name used in the Sass code.
❓ accessibility
expert
2:30remaining
How does using adjust-hue affect color contrast for accessibility?
If you use adjust-hue to rotate a color's hue, what should you check to maintain good accessibility?
AEnsure the rotated color still has sufficient contrast ratio against the background for readability.
BOnly check the hue angle; contrast is not affected by hue changes.
CAdjust-hue automatically improves contrast, so no checks are needed.
DUse adjust-hue only on text colors, not backgrounds.
Attempts:
2 left
💡 Hint
Think about how color contrast affects people with vision impairments.

Practice

(1/5)
1.

What does the adjust-hue function do in Sass?

easy
A. It adjusts the saturation of a color.
B. It changes the brightness of a color.
C. It rotates the hue of a color by a specified degree on the color wheel.
D. It converts a color to grayscale.

Solution

  1. Step 1: Understand the purpose of adjust-hue

    The function changes the hue angle of a color, moving it around the color wheel.
  2. Step 2: Compare with other color functions

    Brightness, grayscale, and saturation are different properties; adjust-hue specifically rotates hue.
  3. Final Answer:

    It rotates the hue of a color by a specified degree on the color wheel. -> Option C
  4. Quick Check:

    adjust-hue rotates hue = D [OK]
Hint: Remember: adjust-hue changes color angle, not brightness or saturation [OK]
Common Mistakes:
  • Confusing hue rotation with brightness or saturation changes
  • Thinking it converts colors to grayscale
  • Assuming it changes color opacity
2.

Which of the following is the correct syntax to rotate the hue of #ff0000 by 90 degrees using adjust-hue in Sass?

?
easy
A. adjust-hue(#ff0000, 90deg)
B. adjust-hue(#ff0000, 90)
C. adjust-hue(#ff0000 90deg)
D. adjust-hue(#ff0000; 90deg)

Solution

  1. Step 1: Check the function syntax

    adjust-hue takes two arguments separated by a comma: the color and the degree number (without unit).
  2. Step 2: Identify correct argument format

    Degrees are passed as a number, not with deg unit in Sass.
  3. Final Answer:

    adjust-hue(#ff0000, 90) -> Option B
  4. Quick Check:

    Use number degrees without unit in adjust-hue = B [OK]
Hint: Use number only for degrees, no 'deg' unit in adjust-hue [OK]
Common Mistakes:
  • Adding 'deg' unit to degree argument
  • Missing comma between arguments
  • Using semicolon instead of comma
3.

What color will be produced by this Sass code?

$color: #00ff00;
$new-color: adjust-hue($color, 120);

Choose the closest hex color output for $new-color.

medium
A. #ffff00
B. #ff0000
C. #00ffff
D. #0000ff

Solution

  1. Step 1: Identify the original color hue

    #00ff00 is pure green, which is at 120° on the color wheel.
  2. Step 2: Rotate hue by 120 degrees

    Adding 120° to green (120°) gives 240°, which is blue.
  3. Step 3: Correct hue calculation

    Green is 120°, adding 120° gives 240°, which corresponds to blue (#0000ff).
  4. Step 4: Re-examine options

    Since 120 + 120 = 240°, the color is blue (#0000ff), so #0000ff is correct.
  5. Final Answer:

    #0000ff -> Option D
  6. Quick Check:

    Green + 120° hue rotation = Blue = #0000ff [OK]
Hint: Add degrees to hue; green(120°) +120° = blue(240°) [OK]
Common Mistakes:
  • Confusing hue degrees and resulting colors
  • Not wrapping hue around 360 degrees
  • Mixing RGB hex with hue values
4.

Identify the error in this Sass code snippet:

$base-color: #ff00ff;
$new-color: adjust-hue($base-color 60deg);
medium
A. Missing comma between arguments and incorrect degree unit.
B. Using an invalid color code.
C. adjust-hue cannot be used with variables.
D. The function requires three arguments.

Solution

  1. Step 1: Check argument separation

    Arguments in adjust-hue must be separated by a comma; here, comma is missing.
  2. Step 2: Check degree argument format

    Degrees should be passed as a number without deg unit in Sass.
  3. Final Answer:

    Missing comma between arguments and incorrect degree unit. -> Option A
  4. Quick Check:

    Comma and number-only degrees needed = C [OK]
Hint: Always separate args with comma and use number for degrees [OK]
Common Mistakes:
  • Omitting comma between function arguments
  • Adding 'deg' unit to degree argument
  • Assuming adjust-hue needs three arguments
5.

You want to create a color palette by rotating the hue of #336699 by increments of 45 degrees four times. Which Sass code correctly generates the list of rotated colors?

?
hard
A. $base: #336699; $palette: ( adjust-hue($base, 45), adjust-hue($base, 90), adjust-hue($base, 135), adjust-hue($base, 180) );
B. $base: #336699; $palette: ( adjust-hue($base 45), adjust-hue($base 90), adjust-hue($base 135), adjust-hue($base 180) );
C. $base: #336699; $palette: ( adjust-hue($base, 45deg), adjust-hue($base, 90deg), adjust-hue($base, 135deg), adjust-hue($base, 180deg) );
D. $base: #336699; $palette: ( adjust-hue($base, 45), adjust-hue($base, 90), adjust-hue($base, 135), adjust-hue($base, 225) );

Solution

  1. Step 1: Verify argument syntax for adjust-hue

    Degrees must be numbers without units and arguments separated by commas.
  2. Step 2: Check the increments and values

    Rotations are 45, 90, 135, and 180 degrees, which are correct increments of 45.
  3. Step 3: Compare options

    $base: #336699; $palette: ( adjust-hue($base, 45), adjust-hue($base, 90), adjust-hue($base, 135), adjust-hue($base, 180) ); uses correct syntax and increments. $base: #336699; $palette: ( adjust-hue($base 45), adjust-hue($base 90), adjust-hue($base 135), adjust-hue($base 180) ); misses commas. $base: #336699; $palette: ( adjust-hue($base, 45deg), adjust-hue($base, 90deg), adjust-hue($base, 135deg), adjust-hue($base, 180deg) ); uses invalid 'deg' units. $base: #336699; $palette: ( adjust-hue($base, 45), adjust-hue($base, 90), adjust-hue($base, 135), adjust-hue($base, 225) ); has wrong last increment (225 instead of 180).
  4. Final Answer:

    code with correct syntax and increments -> Option A
  5. Quick Check:

    Correct syntax + increments = A [OK]
Hint: Use commas and number degrees; check increments carefully [OK]
Common Mistakes:
  • Using 'deg' units in degrees
  • Missing commas between arguments
  • Incorrect increment values in rotation
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard