color.is-missing() returns a boolean: true when a named channel is missing on $color (written as CSS none), otherwise false. Load it with @use "sass:color" on Dart Sass 1.79+. There is no separate global alias.
The $channel argument must be a quoted string such as "green", "hue", or "alpha". Missing channels often come from explicit none, or after a space conversion when a channel is not meaningful (for example grey converted to lch can lose hue).
Examples target Dart Sass 1.79+. Booleans are interpolated into custom properties so you can open View Compiled CSS. @debug lines print to the compiler terminal / log.
Example 1 — Normal Hex Has No Missing Channels
A complete RGB hex reports false for green (official sample).
Pair with channel() — missing still reads as 0 there.
Dart Sass 1.79+ module API only — no global alias.
One line:color.is-missing tells you when a channel is truly absent — not just zero.
Compile
Compile Notes
Conceptual flow:
flow.txt
1. @use "sass:color" (Dart Sass 1.79+)
2. Resolve $color and quoted $channel
3. Return true if that channel is missing (none)
4. Return false if the channel has a real value
5. CSS sees only the boolean or the branched result
Frequently Asked Questions
color.is-missing($color, $channel) returns true if that channel is missing on the color. Example: color.is-missing(rgb(100 none 200), "green") is true.
Pass a quoted string such as "green", "hue", or "alpha". Unquoted names are not correct for $channel.
color.channel() returns a number and uses 0 (sometimes with a unit) when a channel is missing. color.is-missing() returns a boolean so you can tell missing apart from a real zero.
Commonly from CSS none in a color function (rgb(100 none 200)), or when a channel is powerless after converting spaces—for example grey converted to lch can have a missing hue.
No. Use the module form color.is-missing() after @use "sass:color".