color.saturation() belongs to the built-in sass:color module (Deprecated Functions). It returns a legacy color’s HSL saturation as a number from 0% to 100% at compile time. This page covers the vividness dial, siblings hue / lightness, how it differs from saturate() / desaturate(), migration to color.channel(), and five compiled examples.
01
Concept
HSL saturation 0%–100%
02
Status
Deprecated
03
Siblings
hue() / lightness()
04
Legacy only
rgb / hsl / hwb
05
Migrate
color.channel()
06
Practice
5 examples
Concept
What Is color.saturation()?
Saturation is how vivid a color looks on the HSL scale—from gray (0%) through soft pastels to full chroma (100%). Official docs: color.saturation() returns that percent as a number between 0% and 100%. It only reads the value; it does not saturate or desaturate the color.
color.saturation(#e1d7d2) → 20%
color.saturation(#f2ece4) → 35%
color.saturation(#dadbdf) → 7.2463768116%
💡
Beginner tip
Think of HSL as three dials: hue (angle), saturation (how vivid), and lightness (how bright). color.saturation turns only the vividness dial into a number you can store, compare, or log—handy before calling saturate() or desaturate() in legacy code.
Foundation
📝 Syntax
Load the color module, then pass a legacy color:
styles.scss
@use "sass:color";
// Deprecated — still works on legacy colors
color.saturation($color)
// Optional — bring members into scope
@use "sass:color" as *;
saturation($color)
// Recommended migration (Dart Sass 1.79+)
color.channel($color, "saturation")
Parameters
Parameter
Type
Description
$color
Color
Must be in a legacy color space (rgb, hsl, or hwb).
Return value
Type
Meaning
Number (with %)
HSL saturation from 0% to 100%.
Modules
📦 Loading sass:color & Migrating
Prefer the namespaced form. Bare saturation() only works after @use "sass:color" as *;—otherwise CSS may keep the call as a plain string.
styles.scss
@use "sass:color";
// Old (deprecated, still available)
$s: color.saturation(#e1d7d2); // 20%
// New — preferred on Dart Sass 1.79+
$s: color.channel(#e1d7d2, "saturation");
// Optional global-style import
@use "sass:color" as *;
$s: saturation(#e1d7d2);
⚠️
Version note for color.channel
color.channel() needs Dart Sass 1.79+. On older compilers, keep color.saturation() until you can upgrade—then migrate.
Details
🎨 HSL Trio: Hue, Saturation, Lightness
Official docs also list color.hue() and color.lightness() the same way (deprecated readers for the other two HSL channels). Together they rebuild the classic hsl(h, s, l) triple from any legacy color.
Saturation 0% → gray (no chroma; hue is powerless)
Saturation near 50% → clear color without max punch
This is about Sass compilers, not browsers. Compiled CSS receives a finished number—no color.saturation() call remains at runtime.
Feature
Dart Sass
Notes
color.saturation() / saturation()
Yes (deprecated)
Legacy colors only
Siblings hue() / lightness()
Yes (deprecated)
Same pattern for the other HSL channels
color.channel(…, "saturation")
1.79+
Official recommended replacement
LibSass / Ruby Sass
Globals likely
May lack modern @use / channel
Cheat Sheet
⚡ Quick Reference
Goal
Code
Warm taupe
color.saturation(#e1d7d2) → 20%
Cream
color.saturation(#f2ece4) → 35%
Cool gray
color.saturation(#dadbdf) → 7.2463768116%
Brand hex
color.saturation(#336699) → 50%
Pure red
color.saturation(#f00) → 100%
Modern read
color.channel($c, "saturation")
Change saturation
color.scale($c, $saturation: 20%)
Hands-On
Examples Gallery
Examples use color.saturation(). Open View Compiled CSS for verified output (matches official Sass docs samples where noted; cream uses the verified 35% from Dart Sass).
📚 Getting Started
Official docs samples for soft, cream, and cool surfaces.
Cream sits at a moderate 35% (same seed used in desaturate(#f2ece4, …) tutorials). The cool gray is almost muted at ~7%—a large fixed desaturate would snap it to gray quickly.
📈 Practical Patterns
Extremes, soft vs vivid compares, and the global alias.
Soft taupe and mint both sit at 20%—that is why desaturate(#d2e1dd, 30%) collapses to gray. Navy near 80% explains the saturate(#0e4982, 30%) full-chroma trap. Reading saturation first avoids surprises.
Example 5 — Global saturation() with as *
Older stylesheets sometimes import the module into the current namespace.
styles.scss
@use "sass:color" as *;
.panel {
--saturation: #{saturation(#e1d7d2)};
}
📤 Compiled CSS:
.panel {
--saturation: 20%;
}
How It Works
With as *, saturation() matches color.saturation(). Prefer the namespaced form (then color.channel) when you modernize the file. Do not confuse this reader with the deprecated global saturate() writer.
Applications
🚀 Real-World Use Cases
Reading legacy SCSS — recognize color.saturation in older HSL workflows.
Safe migrations — replace with color.channel($c, "saturation") on Dart Sass 1.79+.
Token audits — sort accents by vividness before saturate / desaturate.
Conditional mixins — skip saturate when saturation is already above 80%.
Teaching HSL — show why soft colors clamp to gray under fixed desaturate.
🧠 How Compilation Works
1
Write SCSS
Call color.saturation($c) or migrate to color.channel.
Source
2
Map to HSL
Sass views the legacy color in hue / saturation / lightness.
HSL
3
Read saturation
You get a number from 0% to 100%.
Number
4
✓
CSS sees the number
Custom properties get finished values—not a Sass call.
Watch Out
⚠️ Common Pitfalls
Using it in new code — prefer color.channel($c, "saturation").
Confusing with saturate() — saturation reads; saturate writes a new color.
Bare saturation() without as * — may compile as a CSS function string.
Modern color spaces — $color must be legacy for color.saturation.
Expecting a color back — this helper reads a percent; use scale/adjust to change.
Pro Tips
💡 Best Practices
✅ Do
Migrate to color.channel($c, "saturation") on Dart Sass 1.79+
Use @use "sass:color" and namespaced color.saturation()
Pair with hue/lightness when auditing full HSL
Read saturation before large saturate / desaturate amounts
Document intentional brand chroma on the scale
❌ Don’t
Add new color.saturation() calls in greenfield projects
Pass modern oklch colors into color.saturation
Call bare saturation() without importing the module
Expect the browser to re-run Sass at runtime
Use a reader when you meant saturate() or color.scale
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about color.saturation()
Deprecated HSL saturation reader—migrate to color.channel.
5
Core concepts
📝01
Call
color.saturation($c)
API
⚠️02
Status
Deprecated
Docs
🎨03
Returns
0% … 100%
HSL
🔄04
Siblings
hue() / lightness()
Trio
✓05
Replace
channel(..., "saturation")
Migrate
❓ Frequently Asked Questions
color.saturation($color) returns the HSL saturation of a legacy color as a number between 0% and 100%. Example: color.saturation(#e1d7d2) is 20%; color.saturation(#f2ece4) is 35%; color.saturation(#dadbdf) is about 7.25%.
Yes. Official Sass docs list it under Deprecated Functions and say it is no longer recommended because it is redundant with color.channel($color, "saturation").
A number from 0% to 100% (with the % unit). It is still a Sass number—meta.type-of reports number.
Official docs require a legacy color space (rgb, hsl, or hwb). Convert first, or use color.channel($color, "saturation", $space: hsl) on Dart Sass 1.79+.
color.hue(), color.saturation(), and color.lightness() are sibling deprecated readers for the three HSL channels. Prefer color.channel with "hue", "saturation", or "lightness" in new code.
color.saturation() only reads the saturation percent. saturate() is a separate deprecated global that increases saturation and returns a new color. Prefer color.channel to read and color.scale / color.adjust to change.
Replace color.saturation($color) with color.channel($color, "saturation") after @use "sass:color" on Dart Sass 1.79+. Keep color.saturation only when maintaining older compilers or legacy SCSS.
Did you know?
Official Sass docs keep dedicated HSL readers like color.saturation() for compatibility, but the modern story is one API: color.channel($c, "saturation")—the same pattern you use for hue, lightness, red, green, and more.
color.saturation() reads a legacy color’s HSL saturation as a number from 0% to 100%. Treat it as deprecated documentation: prefer color.channel($color, "saturation") for new SCSS on Dart Sass 1.79+.