diff --git a/crates/typst/src/geom/stroke.rs b/crates/typst/src/geom/stroke.rs index e88d887db..5fb64c901 100644 --- a/crates/typst/src/geom/stroke.rs +++ b/crates/typst/src/geom/stroke.rs @@ -262,6 +262,10 @@ cast! { paint: Smart::Custom(color.into()), ..Default::default() }, + gradient: Gradient => Self { + paint: Smart::Custom(gradient.into()), + ..Default::default() + }, mut dict: Dict => { fn take(dict: &mut Dict, key: &str) -> StrResult> { Ok(dict.take(key).ok().map(T::from_value) diff --git a/tests/typ/visualize/shape-rect.typ b/tests/typ/visualize/shape-rect.typ index 98450c801..6447b55d4 100644 --- a/tests/typ/visualize/shape-rect.typ +++ b/tests/typ/visualize/shape-rect.typ @@ -51,7 +51,7 @@ #rect(radius: (left: 10pt, cake: 5pt)) --- -// Error: 15-21 expected length, color, dictionary, stroke, none, or auto, found array +// Error: 15-21 expected length, color, gradient, dictionary, stroke, none, or auto, found array #rect(stroke: (1, 2)) ---