typst/typst · error · SourceDiagnostic

green component

Error message

green component

What it means

Error "green component" thrown in typst/typst.

Source

Thrown at crates/typst-library/src/visualize/color.rs:540

        green: Component,
        /// The blue component.
        #[external]
        blue: Component,
        /// The alpha component.
        #[external]
        alpha: Component,
        /// Alternatively: The color to convert to linear RGB(A).
        ///
        /// If this is given, the individual components should not be given.
        #[external]
        color: Color,
    ) -> SourceResult<Color> {
        Ok(Self::Process(ProcessColor::LinearRgb(
            if let Some(color) = args.find::<Color>()? {
                color.to_linear_rgb()
            } else {
                let Component(r) = args.expect("red component")?;
                let Component(g) = args.expect("green component")?;
                let Component(b) = args.expect("blue component")?;
                let Component(a) = args.eat()?.unwrap_or(Component(Ratio::one()));
                LinearRgb::new(
                    r.get() as f32,
                    g.get() as f32,
                    b.get() as f32,
                    a.get() as f32,
                )
            },
        )))
    }

    /// Create an RGB(A) color.
    ///
    /// The color is specified in the sRGB color space.
    ///
    /// An RGB(A) color is represented internally by an array of four
    /// components:

View on GitHub (pinned to a51e028041)

When it happens

Trigger: Thrown at crates/typst-library/src/visualize/color.rs:540 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of typst/typst@a51e028041 (2026-08-16). Data as JSON: /api/errors/4a393ed88e6602c4. Report an issue: GitHub.