Rac. StyleContainer

Container of Stroke and Fill objects which get applied sequentially when drawing.

Can be used as container.apply() to apply the contained styles globally, or as the parameter of drawable.draw(container) to apply the style settings only for that draw.

Constructor

new StyleContainer()

Members

rac :Rac

Instance of Rac used for drawing and passed along to any created object.

styles :Array

Container of style objects to apply.

Can be manipulated directly to add or remove styles from this. Most of the implemented methods like add return a new StyleContainer with an copy of this.styles.

Methods

appendStyle(style) → {Rac.StyleContainer}

Returns a new StyleContainer with style appended at the end of styles. When style is null, returns this instead.

this is not modified by this method, the new StyleContainer is created with a copy of this.styles.

Parameters:
Name Type Description
style Rac.Stroke | Rac.Fill | Rac.StyleContainer

A style object to append to styles

container() → {Rac.StyleContainer}

Returns a new StyleContainer containing a copy of this.styles.

toString() → {String}

Returns a string representation intended for human consumption.