color.is-missing() belongs to the built-in sass:color module. It answers: is this named channel missing on the color? This page covers quoted channel names, CSS none, powerless channels after space conversion, how it pairs with color.channel(), the Dart Sass 1.79+ requirement, and five examples.
01
Concept
Missing channels
02
Module
@use "sass:color"
03
Names
Quoted strings
04
Sources
none · powerless
05
Vs
color.channel()
06
Practice
5 examples
Concept
What Is color.is-missing()?
Missing means “this dial is not present,” not “this dial reads zero.” Official docs: is-missing returns whether $channel is missing in $color. That matters for modern CSS colors that can use none, and for conversions that leave a channel powerless.
Think of a mixer board where one knob was never installed. Reading it as 0 can be misleading. is-missing tells you the knob is absent; channel alone may just report zero.
Foundation
📝 Syntax
Load the color module, then pass a color and a quoted channel name:
Channel name, e.g. "red", "green", "hue", "alpha".
Return value
Type
Meaning
Boolean
true if that channel is missing; otherwise false.
Modules
📦 Loading sass:color
There is no separate global is-missing() built-in. Use the module form on Dart Sass 1.79+.
styles.scss
// Recommended — namespaced (Dart Sass 1.79+)
@use "sass:color";
$miss: color.is-missing(rgb(100 none 200), "green");
// Optional — bring members into the current namespace
@use "sass:color" as *;
$miss: is-missing(rgb(100 none 200), "green");
// Optional — custom namespace
@use "sass:color" as c;
$miss: c.is-missing(rgb(100 none 200), "green");
⚠️
Version gate
If Dart Sass reports Undefined function for color.is-missing, upgrade to 1.79+. Older compilers do not include this helper.
Sources
🎨 When Is a Channel Missing?
Beginners usually meet missing channels in two situations:
Source
Example
What is missing?
CSS none in a color function
rgb(100 none 200)
Green channel
Powerless channel after conversion
color.to-space(grey, lch)
Hue (greys have no meaningful hue)
Normal hex / rgb colors
#b37399
Nothing—is-missing is false
Compare
📋 is-missing vs color.channel()
Official channel() docs say missing channels return 0 (possibly with a unit), and point you to is-missing for an explicit check.
Helper
Returns
Job
color.is-missing()
Boolean
“Is this channel absent?”
color.channel()
Number
“What value does this channel have?” (missing → 0)
styles.scss
@use "sass:color";
$c: rgb(100 none 200);
// true — green is absent
$missing: color.is-missing($c, "green");
// 0 — do not assume green was intentionally zero
$value: color.channel($c, "green");
Support
🛠 Compatibility
This is about Sass compilers, not browsers. The boolean is resolved at compile time—CSS never sees a color.is-missing() call.
Green is missing (true), and channel() still reports 0. Without is-missing, you might think green was set to zero on purpose.
Applications
🚀 Real-World Use Cases
Modern CSS color parsing — handle none safely in design tokens.
Space-conversion helpers — detect powerless hue/chroma after to-space.
Mixin guards — skip hue rotates when hue is missing.
Debugging palettes — log which channels are absent vs zero.
color-mix workflows — missing channels can inherit from the other color when mixing.
🧠 How Compilation Works
1
Write SCSS
Call color.is-missing($color, "green") after @use.
Source
2
Resolve the channel
Sass looks up the quoted channel on that color.
Inspect
3
Return a boolean
true if absent, false if present.
Boolean
4
✓
Plain CSS ships
Browsers see true/false or branched results—not a Sass call.
Watch Out
⚠️ Common Pitfalls
Old Dart Sass — color.is-missing needs 1.79+.
Unquoted channel names — use "green", not bare green.
Trusting channel() == 0 — zero can mean missing; check is-missing.
Expecting a color back — this helper returns a boolean.
Looking for a global alias — use color.is-missing() from the module.
Pro Tips
💡 Best Practices
✅ Do
Run Dart Sass 1.79+ before relying on is-missing
Quote channel names every time
Pair with color.channel() when values and presence both matter
Guard hue/chroma logic after converting greys
Prefer @use "sass:color"
❌ Don’t
Ship CI on older Dart Sass and expect this function to exist
Treat every 0 from channel() as intentional
Forget that none creates missing channels
Rely on LibSass / Ruby Sass
Skip checks before hue rotations on near-grey colors
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about color.is-missing()
Boolean channel presence—separate missing from zero, Dart Sass 1.79+.
5
Core concepts
📝01
Call
is-missing($c, "hue")
API
📦02
Needs
Dart Sass 1.79+
Version
🎨03
Channel
quoted string
Name
⚡04
Sources
none / powerless
Cause
✓05
Pair
channel()
Sibling
❓ 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".
Did you know?
Official Sass docs for color.channel() explicitly recommend color.is-missing() when you need to detect missing channels, because a missing channel can look like 0 if you only read the number. That tiny boolean keeps modern CSS none and powerless channels from being misread as intentional zeros.
color.is-missing() is the boolean check for absent color channels. Use it whenever none, powerless hues, or channel() zeros could be ambiguous—on Dart Sass 1.79+.