Sass color.saturation()

Beginner
11 min read
Updated: Nov 2026
5 examples
Deprecated reader

Definition and Usage

color.saturation($color) returns the HSL saturation of a legacy color as a number between 0% and 100%. Global alias: saturation($color).

Official Sass docs mark it deprecated — prefer color.channel($color, "saturation") on Dart Sass 1.79+. Pair with color.hue() and color.lightness() when auditing a full HSL triple.

No longer recommended.

Because color.saturation() is redundant with color.channel(), migrate readers to the channel API in new code. Do not confuse this reader with the deprecated writer saturate().

Official samples.

color.saturation(#e1d7d2) → 20%. #f2ece4 → 35%. #dadbdf → 7.2463768116%.

Legacy colors only.

$color must be in a legacy space (rgb, hsl, or hwb). For modern spaces, use color.channel(..., $space: hsl).

Syntax

SCSS
@use "sass:color";

// Deprecated reader
color.saturation(#e1d7d2); // 20%
color.saturation(#f2ece4); // 35%
color.saturation(#dadbdf); // 7.2463768116%

// Prefer today (Dart Sass 1.79+)
color.channel(#e1d7d2, "saturation");
color.channel($c, "saturation", $space: hsl);

Pattern: recognize color.saturation in old files → rewrite with color.channel($c, "saturation").

Migrate to color.channel

Side-by-side mapping:

Legacy / currentPrefer (1.79+)
color.saturation($c)color.channel($c, "saturation")
saturation($c) (global)color.channel($c, "saturation")
color.hue($c) / color.lightness($c)color.channel($c, "hue") / "lightness"
Force HSL spacecolor.channel($c, "saturation", $space: hsl)

To change saturation, use writers like color.scale($c, $saturation: …) or color.adjust($c, $saturation: …, $space: hsl) — not the reader. Avoid new saturate() / desaturate() calls.

SCSS Examples

Examples use color.saturation(). Open View Compiled CSS for verified output (matches official Sass docs samples where noted).

Example 1 — Warm Hex Saturation (Official Docs)

A soft taupe hex reports saturation 20%.

SCSS
@use "sass:color";

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

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

How It Works

  1. Legacy hex is mapped into HSL.
  2. Saturation percent is 20%.
  3. Interpolation writes it into a custom property.
  4. Same read via color.channel(#e1d7d2, "saturation") on 1.79+.

Example 2 — Cream and Cool Gray (Official Docs)

Two more official samples: a warmer cream and a near-gray cool tone.

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

  1. Cream sits at a modest 35% saturation.
  2. Cool gray is nearly muted (~7.25%).
  3. Fractional percents are normal for converted hex.
  4. Compare tokens before deciding which to punch up with scale.

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

The extremes of the HSL saturation dial.

SCSS
@use "sass:color";

.extremes {
  --gray: #{color.saturation(#808080)};
  --navy: #{color.saturation(#036)};
}

How It Works

  1. Equal RGB channels mean no chroma → saturation 0%.
  2. #036 is fully saturated navy → 100%.
  3. Handy check that your reader matches the official scale.
  4. Migration path should produce the same extremes.

Example 4 — Branch When Saturation Is Soft

Use the percent number in a simple if() when tagging tokens.

SCSS
@use "sass:color";

$brand: #e1d7d2;

.report {
  --sat: #{color.saturation($brand)};
  --soft: #{if(color.saturation($brand) < 40%, "soft", "vivid")};
}

How It Works

  1. Saturation is a percent number, so comparisons work in Sass.
  2. 20% < 40% is true → label soft.
  3. On 1.79+, swap in color.channel($brand, "saturation").
  4. Writers still use scale / adjust — not this reader.

Example 5 — Global saturation() with as *

Older stylesheets sometimes import the module into the current namespace.

SCSS
@use "sass:color" as *;

.panel {
  --saturation: #{saturation(#f2ece4)};
}

How It Works

  1. as * brings members into the current scope.
  2. saturation() matches color.saturation().
  3. Result is still 35%.
  4. Prefer namespaced color.saturation, then color.channel, when modernizing.

Edge Cases & Pitfalls

Most saturation-reader bugs are writing vs reading, modern spaces, or confusing saturate().

read

Readers do not change saturation

color.saturation only returns a percent. To shift saturation, use color.scale / color.adjust — not saturate() in new code.

name

saturation() ≠ saturate()

One reads. One writes (deprecated). Easy typo in reviews.

space

Legacy colors only for this helper

Official docs require rgb / hsl / hwb. Prefer color.channel(..., $space: hsl) for modern spaces.

migrate

Quote the channel name

Write color.channel($c, "saturation") with a quoted string.

Sass Support

color.saturation() remains for compatibility. New readers should use color.channel on Dart Sass 1.79+.

APIStatus
color.saturation() / saturation()Deprecated reader — still works on legacy colors
color.channel($c, "saturation")Preferred on Dart Sass 1.79+
LibSass / Ruby SassGlobal saturation() may exist — no modern module path
BrowsersN/A — only see compiled CSS values

Compile with the Dart Sass CLI.

Key Takeaways

  • Reads HSL saturation as a percent from 0% to 100%.
  • Deprecated in favor of color.channel($c, "saturation").
  • Siblings: color.hue() and color.lightness().
  • Writers use scale/adjust — not this reader (and avoid new saturate()).

One line: use color.saturation to understand old HSL reads — write new ones with color.channel.

Migrate Notes

Practical checklist:

migrate.txt
1. Find color.saturation($c) / saturation($c) in legacy SCSS
2. Require Dart Sass 1.79+ for color.channel
3. Replace with color.channel($c, "saturation")
4. Add $space: hsl when reading non-legacy colors
5. Use scale/adjust when you need to write saturation

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.

Next: Sass transparentize()

Deprecated fixed alpha decrease — prefer color.scale.

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.

8 people found this page helpful