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
Concept
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.
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.
Foundation
📝 Syntax
Call the global function with a legacy color and a hue delta:
Must be in a legacy color space (rgb, hsl, or hwb).
$degrees
Number
Hue delta between -360deg and 360deg (inclusive). Unitless or any angle unit.
Return value
Type
Meaning
Color
A new color with the HSL hue shifted by $degrees. Compiles to a finished CSS color.
Modules
📦 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.
Details
🎨 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 -360deg…360deg 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 angle
color.change($c, $hue: 210deg)
Opposite hue (~180deg)
color.complement($c)
Compare
📋 adjust-hue vs color.adjust
Same idea for hue—different APIs and futures.
Helper
Job
Status
adjust-hue()
Shift HSL hue only (legacy colors)
Deprecated global
color.adjust()
Shift any channel(s), optional $space
Preferred modern API
color.change()
Set absolute channel values
Preferred when you know the target hue
Support
🛠 Compatibility
This is about Sass compilers, not browsers. Compiled CSS receives a finished color—no adjust-hue() call remains at runtime.
Feature
Dart Sass
Notes
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 Sass
Global only
May expose adjust-hue(); lack modern module API
Cheat Sheet
⚡ Quick Reference
Goal
Code
Shift +60deg (legacy)
adjust-hue(#6b717f, 60deg)
Shift −60deg
adjust-hue(#d2e1dd, -60deg)
Unitless delta
adjust-hue(#036, 45)
Modern equivalent
color.adjust($c, $hue: 60deg, $space: hsl)
Absolute hue
color.change($c, $hue: 210deg)
Opposite hue
color.complement($c)
Hands-On
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.
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.
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.
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.
Applications
🚀 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.
Watch Out
⚠️ 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 change — adjust-hue is relative; absolute hue needs color.change.
Out-of-range deltas — stay within -360deg…360deg.
Pro Tips
💡 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
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about adjust-hue()
Deprecated global hue spinner—migrate to color.adjust.
5
Core concepts
📝01
Call
adjust-hue($c, $deg)
API
⚠️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.
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.