Pattern

class Pattern(val content: GroupNode, val tile: Rectangle, val units: PaintUnits = PaintUnits.BOUNDS, val contentUnits: PaintUnits = PaintUnits.OBJECT, val viewBox: Rectangle? = null, val aspectRatio: AspectRatio = AspectRatio.DEFAULT, val transform: Matrix44 = Matrix44.IDENTITY, val id: String = "", val fallback: ColorRGBa? = null) : Paint.Server(source)

A pattern, like SVG's pattern: content drawn in a tile that is repeated in both directions.

The tile is tile in units: the bounds of the painted shape for PaintUnits.BOUNDS, so 0..1 covers the shape, or its coordinates for PaintUnits.OBJECT. transform transforms the tiles, like patternTransform. The content is drawn with its origin at the corner of the tile; viewBox and aspectRatio fit the content into the tile when a view box is given, otherwise contentUnits decide whether its coordinates are in the coordinates of the shape or relative to its bounds.

The tile is drawn to a texture once for every size it is drawn at, changes to content after it is drawn are not seen. fallback is the color that stands in for the pattern where it can not be drawn.

Constructors

Link copied to clipboard
constructor(content: GroupNode, tile: Rectangle, units: PaintUnits = PaintUnits.BOUNDS, contentUnits: PaintUnits = PaintUnits.OBJECT, viewBox: Rectangle? = null, aspectRatio: AspectRatio = AspectRatio.DEFAULT, transform: Matrix44 = Matrix44.IDENTITY, id: String = "", fallback: ColorRGBa? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val fallback: ColorRGBa?
Link copied to clipboard
val id: String
Link copied to clipboard

the id of the pattern in SVG documents: id, or an id derived from the pattern when it has none

Link copied to clipboard
val tile: Rectangle
Link copied to clipboard
open override val transform: Matrix44
Link copied to clipboard
open override val units: PaintUnits
Link copied to clipboard
open override val value: ColorRGBa?
Link copied to clipboard
val viewBox: Rectangle?

Functions

Link copied to clipboard
open override fun source(): SourcePreset

the preset that generates the colors of this paint

Link copied to clipboard
open override fun toString(): String