Stylesheet

fun Stylesheet(    map: Map<String, StyleAttributes>,     palette: Palette,     errors: MutableList<Pair<UnvalidatedStylePattern, StylePatternException>>? = null)

Construct a Stylesheet from (1) the specified map of source patterns and style attributes and (2) the palette for final color selection.

Parameters

map

The map of source patterns to their desired style attributes. Should be arranged in declaration order, as this order establishes the override order during reduction of the final rendering context.

palette

The palette.

errors

The accumulator for errors, as pairs of invalid patterns and exceptions. When non-null, patterns that fail compilation are excised from the result, and any relevant StylePatternExceptions are appended here; when null, the constructor will terminate abnormally (by raising a StylePatternException) upon encountering an invalid source pattern.

Throws

If any of the source patterns fails compilation for any reason.


fun Stylesheet(originalRules: Set<StyleRule>, palette: Palette)

Construct a new Stylesheet. Supplement the supplied rules with any missing rules required to support the system style classifiers.

Parameters

originalRules

The original style rules to inject into the stylesheet, prior to adding defaults for missing system style classifiers. Should be arranged in declaration order, as this order establishes the override order during reduction of the final rendering context.