gradient
rpic extension, inspired by PSTricks’ fillstyle=gradient.
gradient "from" "to" fills a shape with a two-stop linear gradient;
gradientangle sets the direction in pic coordinates — 0 runs left to
right, 90 bottom to top (the same frame as hatchangle).
.PS
box "0°" wid 0.8 ht 0.55 gradient "steelblue" "white"
move right 0.25
box "45°" wid 0.8 ht 0.55 gradient "steelblue" "white" gradientangle 45
move right 0.25
box "90°" wid 0.8 ht 0.55 gradient "steelblue" "white" gradientangle 90
.PERules
- The gradient follows each shape’s own bounding box, so the same
attribute works on boxes, circles, ellipses and
closepolygons:
.PS
circle rad 0.35 gradient "gold" "orangered" gradientangle 90
move right 0.35
line right 0.9 then up 0.65 close gradient "plum" "indigo" gradientangle 90 outlined "black"
.PEgradienttakes the fill slot (wins overfill/shaded); withhatchit paints once across the whole object, under the hatch lines;opacityapplies to the result.- Colors use the same grammar as
shaded— quoted or bare names. - Deferred by design: multi-stop lists, radial gradients, per-stop opacity.
- Rendered as native SVG
<linearGradient>— PNG/PDF rasterize identically offline.
Design notes: docs/svg-styles.md.