ShapeStyle

data class ShapeStyle(val fill: ShapeColor = ShapeColor.NONE, val stroke: ShapeColor = ShapeColor.NONE, val strokeWidth: Double = 0.0, val size: Double = 0.0, val strokeCap: ShapeStrokeCap = ShapeStrokeCap.BUTT)

The concrete paint a shape renders with — fill and stroke colors, stroke geometry, and the open-stroke line cap. Every field holds a definite value; there is no "unspecified" state and no cascade.

"No paint" is spelled ShapeColor.NONE and "no thickness" 0.0, which is what the bare constructor defaults every field to: ShapeStyle(fill = X) leaves size and strokeWidth at zero — a visible color on an invisibly sized shape. Start from a per-shape constant and copy it (ShapeStyle.POINT.copy(fill = X)) unless invisibility is meant.

Constructors

Link copied to clipboard
constructor(fill: ShapeColor = ShapeColor.NONE, stroke: ShapeColor = ShapeColor.NONE, strokeWidth: Double = 0.0, size: Double = 0.0, strokeCap: ShapeStrokeCap = ShapeStrokeCap.BUTT)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The interior paint — also the marker color of point-like shapes; ShapeColor.NONE paints nothing.

Link copied to clipboard

The rendered extent of point markers — side or diameter, renderer-interpreted; 0.0 paints nothing.

Link copied to clipboard

The outline paint; ShapeColor.NONE paints nothing.

Link copied to clipboard

How open strokes terminate — inert on closed shapes; ShapeStrokeCap.BUTT by default.

Link copied to clipboard

The outline thickness, renderer-interpreted; 0.0 paints nothing.