Sass
CSS preprocessor

Sass adjust-hue() Function

Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
Deprecated
Global · Dart Sass

What You’ll Learn

adjust-hue() is a global Sass helper documented in the sass:color module page (Deprecated Functions). It rotates a legacy color’s HSL hue by $degrees at compile time. This page covers the parameter range, legacy-color rule, why the module system skipped it, how to migrate to color.adjust(), and five compiled examples.

01

Concept

Rotate HSL hue

02

Status

Deprecated global

03

$degrees

−360deg … 360deg

04

Legacy only

rgb / hsl / hwb

05

Migrate

color.adjust()

06

Practice

5 examples

What Is adjust-hue()?

Adjust-hue means “spin this color around the HSL hue wheel by a fixed amount.” Official docs: it increases or decreases $color’s HSL hue. Saturation and lightness stay put—only the hue angle moves. Positive degrees go one way around the wheel; negative degrees go the other.

  • adjust-hue(#6b717f, 60deg)#796b7f (hue 222deg → 282deg)
  • adjust-hue(#d2e1dd, -60deg)#d6e1d2 (hue 164deg → 104deg)
  • adjust-hue(#036, 45)#1a0066 (hue 210deg → 255deg)
💡
Beginner tip

Think of a color wheel marked in degrees. 60deg is a gentle shift; 180deg is a full opposite (similar idea to color.complement()). adjust-hue is the old dedicated knob; modern Sass uses color.adjust() for the same job—and for every other channel too.

📝 Syntax

Call the global function with a legacy color and a hue delta:

styles.scss
// Deprecated global (legacy colors only)
adjust-hue($color, $degrees)

// Recommended migration (module system)
@use "sass:color";
color.adjust($color, $hue: $degrees, $space: hsl) // Dart Sass 1.79+

Parameters

ParameterTypeDescription
$colorColorMust be in a legacy color space (rgb, hsl, or hwb).
$degreesNumberHue delta between -360deg and 360deg (inclusive). Unitless or any angle unit.

Return value

TypeMeaning
ColorA new color with the HSL hue shifted by $degrees. Compiles to a finished CSS color.

📦 Why There Is No color.adjust-hue()

Official docs’ heads-up: because adjust-hue() is redundant with color.adjust(), it is not included directly in the new module system. You will not find color.adjust-hue after @use "sass:color".

styles.scss
// Old (deprecated global)
$accent: adjust-hue(#6b717f, 60deg);

// New — preferred
@use "sass:color";
$accent: color.adjust(#6b717f, $hue: 60deg, $space: hsl); // Dart Sass 1.79+

// Also works for many legacy colors on older Dart Sass
$accent: color.adjust(#6b717f, $hue: 60deg);
⚠️
Version note for $space

Official migration uses $space: hsl, which needs Dart Sass 1.79+. On older compilers, color.adjust($c, $hue: …) still shifts hue for typical hex/RGB colors—verify your Sass version if $space errors with No argument named $space.

🎨 Understanding $degrees

The second argument is a relative hue change, not an absolute hue target. Official docs allow any angle unit or a unitless number in the -360deg360deg range.

  • 60deg and unitless 60 produce the same shift for hex brands.
  • Negative values rotate the opposite direction (-60deg).
  • For an absolute hue, use color.change() with $hue instead.
Want…Use
Relative hue spin (old API)adjust-hue($c, 30deg)
Relative hue spin (modern)color.adjust($c, $hue: 30deg, $space: hsl)
Set hue to exact anglecolor.change($c, $hue: 210deg)
Opposite hue (~180deg)color.complement($c)

📋 adjust-hue vs color.adjust

Same idea for hue—different APIs and futures.

HelperJobStatus
adjust-hue()Shift HSL hue only (legacy colors)Deprecated global
color.adjust()Shift any channel(s), optional $spacePreferred modern API
color.change()Set absolute channel valuesPreferred when you know the target hue

🛠 Compatibility

This is about Sass compilers, not browsers. Compiled CSS receives a finished color—no adjust-hue() call remains at runtime.

FeatureDart SassNotes
Global adjust-hue()Yes (deprecated)Legacy colors only; omitted from sass:color
color.adjust($hue: …)Yes (module)Preferred replacement for new SCSS
color.adjust(…, $space: hsl)1.79+Official migration form from Sass docs
LibSass / Ruby SassGlobal onlyMay expose adjust-hue(); lack modern module API

⚡ Quick Reference

GoalCode
Shift +60deg (legacy)adjust-hue(#6b717f, 60deg)
Shift −60degadjust-hue(#d2e1dd, -60deg)
Unitless deltaadjust-hue(#036, 45)
Modern equivalentcolor.adjust($c, $hue: 60deg, $space: hsl)
Absolute huecolor.change($c, $hue: 210deg)
Opposite huecolor.complement($c)

Examples Gallery

Examples use the deprecated global adjust-hue() where noted, plus a modern color.adjust() migration. Open View Compiled CSS for verified output (matches official Sass docs samples).

📚 Getting Started

Official docs samples for positive and negative hue shifts.

Example 1 — Shift Hue +60deg (Official Docs)

Hue 222deg becomes 282deg on a cool grey-blue brand.

styles.scss
// Hue 222deg becomes 282deg.
@debug adjust-hue(#6b717f, 60deg); // #796b7f

.swatch {
  --base: #6b717f;
  --plus60: #{adjust-hue(#6b717f, 60deg)};
}

How It Works

Sass reads the color in HSL, adds 60deg to the hue, and writes a new hex. The purple-tinted result still shares the original lightness and saturation character.

Example 2 — Shift Hue −60deg (Official Docs)

Hue 164deg becomes 104deg on a soft mint grey.

styles.scss
// Hue 164deg becomes 104deg.
@debug adjust-hue(#d2e1dd, -60deg); // #d6e1d2

.mint {
  color: adjust-hue(#d2e1dd, -60deg);
}

How It Works

Negative $degrees rotates the other way on the wheel. Use this when a palette needs a cooler or warmer neighbor without inventing a new hex by hand.

📈 Practical Patterns

Unitless deltas, migration, and simple theme accents.

Example 3 — Unitless Degrees (Official Docs)

Hue 210deg becomes 255deg when you pass 45 without a unit.

styles.scss
// Hue 210deg becomes 255deg.
@debug adjust-hue(#036, 45); // #1a0066

.deep {
  background: adjust-hue(#036, 45);
}

How It Works

Official docs allow unitless numbers in the same −360…360 range. Prefer deg in new code for clarity, and migrate to color.adjust when you touch the file anyway.

Example 4 — Migrate to color.adjust()

Same +60deg and −60deg results using the modern module API.

styles.scss
@use "sass:color";

// Prefer on Dart Sass 1.79+:
// color.adjust($c, $hue: 60deg, $space: hsl)

.tokens {
  --plus60: #{color.adjust(#6b717f, $hue: 60deg)};
  --minus60: #{color.adjust(#d2e1dd, $hue: -60deg)};
}

How It Works

Outputs match the official adjust-hue samples. When you can use Dart Sass 1.79+, add $space: hsl so the hue edit is explicit about the color space.

Example 5 — Build a Mini Hue Palette

Derive warm and cool accents from one brand hex (legacy API for reading old code).

styles.scss
$brand: #336699;

.palette {
  --brand: #{$brand};
  --warm: #{adjust-hue($brand, 30deg)};
  --cool: #{adjust-hue($brand, -30deg)};
  --far: #{adjust-hue($brand, 120deg)};
}

How It Works

One seed color yields related accents. In new projects, rewrite the same idea with color.adjust($brand, $hue: 30deg, $space: hsl) so you stay on the supported module API.

🚀 Real-World Use Cases

  • Reading legacy SCSS — recognize adjust-hue in older themes and design systems.
  • Safe migrations — replace with color.adjust(… $hue: …) one call at a time.
  • Quick hue neighbors — derive warm/cool accents from a brand hex (prefer modern API).
  • Teaching HSL — show relative hue without changing saturation or lightness.
  • Pairing with complement — small deltas with adjust vs a full 180deg flip.

🧠 How Compilation Works

1

Write SCSS

Call adjust-hue($c, 60deg) or migrate to color.adjust.

Source
2

Read HSL hue

Sass works in HSL for this legacy helper on rgb/hsl/hwb colors.

HSL
3

Add $degrees

Hue moves by the delta; other HSL channels stay related.

Rotate
4

Finished CSS color

Browsers see hex/hsl/rgb—not a Sass function call.

⚠️ Common Pitfalls

  • Using it in new code — it is deprecated; prefer color.adjust.
  • Expecting color.adjust-hue() — that name does not exist in sass:color.
  • Modern color spaces$color must be legacy; convert or use adjust with $space.
  • Confusing with changeadjust-hue is relative; absolute hue needs color.change.
  • Out-of-range deltas — stay within -360deg360deg.

💡 Best Practices

✅ Do

  • Migrate to color.adjust($c, $hue: …, $space: hsl) on Dart Sass 1.79+
  • Use angle units like deg for readable deltas
  • Keep legacy-only constraints in mind when reading old files
  • Prefer color.complement() for a full opposite hue
  • Document brand seeds so hue shifts stay intentional

❌ Don’t

  • Add new adjust-hue() calls in greenfield projects
  • Look for color.adjust-hue in the module
  • Pass modern oklch colors into the global helper
  • Expect the browser to re-run Sass at runtime
  • Use relative hue when you meant an absolute target hue

Key Takeaways

Knowledge Unlocked

Five things to remember about adjust-hue()

Deprecated global hue spinner—migrate to color.adjust.

5
Core concepts
⚠️ 02

Status

Deprecated

Docs
🎨 03

Does

shift HSL hue

Rotate
📦 04

Module?

No color.adjust-hue

Global
05

Replace

color.adjust + $hue

Migrate

❓ Frequently Asked Questions

adjust-hue($color, $degrees) increases or decreases a legacy color’s HSL hue. Example: adjust-hue(#6b717f, 60deg) is #796b7f.
Yes. Official Sass docs list it under Deprecated Functions. It is not part of the sass:color module. Prefer color.adjust($color, $hue: $amount, $space: hsl).
A number between -360deg and 360deg (inclusive). It may be unitless or use any angle unit (deg, turn, rad, and so on).
Because it is redundant with color.adjust(). The new module system intentionally omits adjust-hue(); migrate to color.adjust with $hue and $space: hsl.
No for modern spaces. Official docs require $color to be in a legacy color space (rgb, hsl, or hwb). Convert first, or use color.adjust in a polar space instead.
Replace adjust-hue($color, $amount) with color.adjust($color, $hue: $amount, $space: hsl) after @use "sass:color". On Dart Sass before 1.79, color.adjust($color, $hue: $amount) still shifts hue for legacy colors.
Did you know?

Official Sass docs skip adjust-hue() in the module system on purpose: one general tool (color.adjust) can tweak hue, saturation, lightness, alpha, and more—so a hue-only global helper became redundant.

Conclusion

adjust-hue() is the classic global way to nudge HSL hue on legacy colors. Treat it as deprecated documentation: prefer color.adjust($color, $hue: $amount, $space: hsl) for new SCSS.

Continue with color.adjust(), color.alpha(), or color.complement().

Next: color.alpha()

You learned deprecated adjust-hue()—next is the deprecated opacity reader.

color.alpha() →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful