slint-ui/slint · warning

Missing fill colors for solid color value

Error message

Missing fill colors for solid color value

What it means

getBrush in the Figma inspector's property parser encountered a SOLID paint that has no color payload. It warns and returns an empty string, meaning the node's brush becomes blank in the generated Slint snippet.

Solutions

  1. Check whether the SOLID paint is bound to a color variable and resolve it before calling getBrush
  2. Inspect the node's fills in the plugin API and confirm color is present; re-fetch if it was a transient response gap
  3. Treat empty brush as intended only if the paint is genuinely transparent
  4. Fall back to a neutral color explicitly rather than an empty string if a visible fill is required

Example fix

// before
if (!fill.color) { console.warn(...); return ""; }
// after
if (!fill.color) {
  const viaVar = resolveColorVariable(fill);
  if (viaVar) return viaVar;
  console.warn("Missing fill colors for solid color value");
  return "transparent";
}
Defensive patterns

Strategy: validation

Validate before calling

const solid = fills.find(f => f.type === "SOLID");
if (solid && !solid.color) throw new Error("Solid paint missing color; resolve variable-bound paints first");

Type guard

function hasSolidColor(fill: Paint): fill is SolidPaint & { color: RGBA } {
  return fill.type === "SOLID" && typeof (fill as SolidPaint).color !== "undefined";
}

Try / catch

try {
  brush = getBrush(fill);
} catch (e) {
  brush = "transparent"; // or report to user
}

Prevention

When it happens

Trigger: getBrush (or its callers: getBorderWidthAndColor, generateRectangleSnippet, brush, generatePathNodeSnippet, generateTextSnippet) processes a fill of type 'SOLID' where fill.color is undefined/null.

Common situations: Figma node with a solid paint whose color failed to resolve (e.g. paint bound to a color variable the plugin couldn't resolve); partial/corrupted REST response for fills; plugin API returning a paint with color omitted.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of slint-ui/slint@bb937076de (2026-09-16). Data as JSON: /api/errors/b670f996191dd659. Report an issue: GitHub.

Appendix: source

Thrown at tools/figma-inspector/backend/utils/property-parsing.ts:313

    return properties.length > 0 ? properties : null;
}

export function getBrush(fill: {
    type: string;
    opacity?: number; // Allow opacity to be optional
    color?: { r: number; g: number; b: number };
    gradientStops?: ReadonlyArray<{
        color: { r: number; g: number; b: number; a: number };
        position: number;
    }>;
    gradientTransform?: number[][];
}): string | null {
    const opacity = fill.opacity ?? 1; // Default to 1 if opacity is undefined

    switch (fill.type) {
        case "SOLID": {
            if (!fill.color) {
                console.warn("Missing fill colors for solid color value");
                return "";
            }
            return rgbToHex({ ...fill.color, a: opacity });
        }
        case "GRADIENT_LINEAR": {
            if (!fill.gradientStops || !fill.gradientTransform) {
                console.warn("Missing gradient stops for linear gradient");
                return "";
            }
            return generateLinearGradient({
                opacity: opacity,
                gradientStops: fill.gradientStops,
                gradientTransform: fill.gradientTransform,
            });
        }
        case "GRADIENT_RADIAL": {
            if (!fill.gradientStops || !fill.gradientTransform) {
                return "";

View on GitHub (pinned to bb937076de)