Sass
CSS preprocessor

Sass color.saturation() Function

Beginner
⏱️ 11 min read
📚 Updated: Jul 2026
🎯 5 Examples
Deprecated
sass:color · Dart Sass

What You’ll Learn

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

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.

📝 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

ParameterTypeDescription
$colorColorMust be in a legacy color space (rgb, hsl, or hwb).

Return value

TypeMeaning
Number (with %)HSL saturation from 0% to 100%.

📦 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.

🎨 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
  • Saturation 100% → fully vivid on the HSL scale
💡
Writing saturation instead of reading

To raise or lower saturation, use color.adjust(), color.scale(), or the deprecated globals saturate() / desaturate()—not color.saturation(), which only returns a number.

📋 color.saturation vs color.channel

HelperJobStatus
color.saturation()Read HSL saturation on legacy colorsDeprecated / not recommended
color.channel($c, "saturation")Same read (and any other channel)Preferred on Dart Sass 1.79+
color.scale(..., $saturation: …)Relative saturate / desaturateWriter, not a reader
saturate() / desaturate()Fixed-amount writers (also deprecated)Change color, do not return %

🛠 Compatibility

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

FeatureDart SassNotes
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 SassGlobals likelyMay lack modern @use / channel

⚡ Quick Reference

GoalCode
Warm taupecolor.saturation(#e1d7d2)20%
Creamcolor.saturation(#f2ece4)35%
Cool graycolor.saturation(#dadbdf)7.2463768116%
Brand hexcolor.saturation(#336699)50%
Pure redcolor.saturation(#f00)100%
Modern readcolor.channel($c, "saturation")
Change saturationcolor.scale($c, $saturation: 20%)

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.

Example 1 — Warm Hex Saturation (Official Docs)

A soft taupe hex reports saturation 20%.

styles.scss
@use "sass:color";

@debug color.saturation(#e1d7d2); // 20%

.swatch {
  --saturation: #{color.saturation(#e1d7d2)};
}

How It Works

Sass maps the legacy hex into HSL, reads the saturation percent, and writes that number (with %) into a custom property.

Example 2 — Cream and Cool Grays (Official Docs)

Two more official samples: a soft cream and a cool gray.

styles.scss
@use "sass:color";

@debug color.saturation(#f2ece4); // 35%
@debug color.saturation(#dadbdf); // 7.2463768116%

.palette {
  --cream: #{color.saturation(#f2ece4)};
  --cool: #{color.saturation(#dadbdf)};
}

How It Works

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.

Example 3 — Gray Is 0%, Pure Red Is 100%

The ends of the HSL saturation scale.

styles.scss
@use "sass:color";

.extremes {
  --white: #{color.saturation(white)};
  --black: #{color.saturation(black)};
  --red: #{color.saturation(#f00)};
}

How It Works

Neutrals have no chroma. Pure #f00 is fully saturated—reading first explains why saturate(#f00, 20%) cannot get “more vivid” than it already is.

Example 4 — Soft, Mid, and Deep Saturation

Read familiar seeds used across saturate / desaturate tutorials.

styles.scss
@use "sass:color";

.compare {
  --soft: #{color.saturation(#e1d7d2)};
  --mint: #{color.saturation(#d2e1dd)};
  --mid: #{color.saturation(#6b717f)};
  --navy: #{color.saturation(#0e4982)};
  --deep: #{color.saturation(#036)};
  --brand: #{color.saturation(#336699)};
}

How It Works

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)};
}

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.

🚀 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.

⚠️ 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.

💡 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

Key Takeaways

Knowledge Unlocked

Five things to remember about color.saturation()

Deprecated HSL saturation reader—migrate to color.channel.

5
Core concepts
⚠️ 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.

Conclusion

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+.

Continue with transparentize(), color.channel(), color.lightness(), or CSS Introduction.

Next: transparentize()

You learned deprecated color.saturation()—next, lower alpha with transparentize().

transparentize() →

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