desaturate($color, $amount) decreases a legacy color’s HSL saturation by a fixed percentage (0%–100%) and returns a new color. It is a global built-in — there is nocolor.desaturate().
Examples use deprecated global desaturate() plus modern scale / adjust. Open View Compiled CSS for verified output (matches official Sass docs samples).
Deprecated: fixed HSL saturation subtraction on legacy colors.
Prefer color.scale for “percent less saturated.”
Use color.adjust when you must match old pixels.
No module form — there is no color.desaturate().
One line: learn desaturate to read legacy SCSS; write scale (or adjust) in new code.
Migrate
Migrate Notes
Conceptual flow:
flow.txt
1. Find desaturate($color, $amount)
2. Want "% quieter"? → color.scale($color, $saturation: -$amount)
3. Need same pixels? → color.adjust($color, $saturation: -$amount, $space: hsl)
4. @use "sass:color"
5. Delete the global desaturate() call
Frequently Asked Questions
desaturate($color, $amount) decreases a legacy color’s HSL saturation by $amount (0%–100%). Example: desaturate(#036, 20%) is #0a335c.
Yes. Official Sass docs list it under Deprecated Functions and omit it from the sass:color module. Prefer color.scale() for relative desaturation, or color.adjust($color, $saturation: -$amount, $space: hsl) to keep the old math.
Because desaturate() is usually not the best way to lower saturation, it is not included in the new module system. Use color.scale or color.adjust instead.
desaturate subtracts a fixed saturation amount (20% saturation − 30% becomes gray). color.scale($c, $saturation: -30%) makes the color 30% less saturated than it was, which is usually what designers want.
No for modern spaces. Official docs require a legacy color space (rgb, hsl, or hwb). Convert first, or use color.scale / color.adjust with an explicit $space.
For the same fixed subtraction: color.adjust($color, $saturation: -$amount, $space: hsl) on Dart Sass 1.79+. For better relative desaturation: color.scale($color, $saturation: -$amount).