color.change() sets one or more channels of a color to exact new values and returns a new color. Load it with @use "sass:color". The global alias is change-color().
By default it changes channels in the color’s own space. Pass $space to edit in another space (Dart Sass 1.79+). The result always stays in the original color’s space. Official docs: channels are never clamped for color.change().
Official idea.
Replace the keyword channels with your values. Example: color.change(#6b717f, $red: 100) → #64717f.
Absolute, not relative.
$alpha: 0.4 means “set opacity to 40%,” not “subtract 0.4.” For deltas use color.adjust().
Do not mix channel families.
For legacy colors, do not change RGB and HSL (or HWB) channels in the same call. Pass $space explicitly when you can.
Absolute set:color.change replaces channels with exact values.
Load@use "sass:color" and prefer the module name.
Never clamped — pass valid constructor units.
Need deltas? Use adjust. Relative %? Use scale.
One line:color.change is how modern Sass snaps a color to exact channel targets.
Compile
Compile Notes
Conceptual flow:
flow.txt
1. @use "sass:color"
2. Resolve $color into its color space
3. Replace each keyword channel with the exact value
4. Do not clamp (unlike some adjust paths)
5. Return a new color in the original space for CSS
Frequently Asked Questions
color.change($color, ...) replaces one or more channels with the exact values you pass and returns a new color. Example: color.change(#6b717f, $red: 100) is #64717f.
Add @use "sass:color"; then call color.change($color, $lightness: 30%) or other channel keywords. Prefer the module form in new SCSS.
change sets channels to absolute values. adjust adds or subtracts fixed amounts. scale moves channels fluidly by a percentage of the remaining room toward a bound.
No. Official Sass docs state channels are never clamped for color.change(). color.adjust() may clamp some channels that leave their native range.
The global built-in is change-color(...). On sass:color the helper is color.change(). Prefer color.change() in new code.
Built-in modules with @use need Dart Sass (about 1.23+). $whiteness/$blackness need 1.28+. $space and more modern channels need 1.79+. LibSass and Ruby Sass do not load sass:color the same way.