Skip to contents

fill_none() leaves a drawable's interior entirely unfilled, while still stroking its outline (per style()'s color/linewidth). It's a thin, self-documenting wrapper around fill_solid(NA_character_): NA is already a valid colour to grid::gpar() (rendered as fully transparent), but spelling that out as fill_none() reads more clearly at a call site than a bare NA_character_, and groups discoverably with the rest of the fill_*() family.

Usage

fill_none()

Value

A fill object wrapping NA_character_.

Details

Since every drawable is currently rendered as a closed grid::polygonGrob() (see the "Deferred: open/stroked curve support" item in .agents/PLAN.md), fill_none() gives an unfilled closed outline – the edge connecting the last point back to the first is still drawn. It does not, by itself, produce an open/unstroked curve.

Examples

draw(shape_circle(fill = fill_none(), linewidth = 2))


# still a closed outline: the edge from the last point back to the
# first is drawn even though the interior isn't filled
draw(shape_polygon(
  n = 5L,
  fill = fill_none(),
  color = "steelblue",
  linewidth = 3
))