Skip to content

Latest commit

History

History
55 lines (36 loc) 路 2.34 KB

File metadata and controls

55 lines (36 loc) 路 2.34 KB

Elements

Elements map extension models (e.g. layers and colors) to their style properties. Currently, there are two elements:

Layer

constructor(layerObject): Layer

Creates an instance from an extension layer instance.

Parameters:

style: RuleSet

Returns style properties of the layer and a selector, represented by a RuleSet instance.

childrenStyle: RuleSet

If the layer contains one or more elements, returns style properties of each child, represented by a RuleSet instance.

hasBlendMode: boolean

Returns true if the layer has a fill with a blend mode other than normal.

hasGradient: boolean

Returns true if the layer has a gradient fill.

hasFill: boolean

Returns true if the layer has a fill.

backgroundImages: Array<Gradient>

Returns fills of the layer as Gradient values.

fillColor: Color

If the layer has multiple color fills and the blend mode is set to normal for each, returns the blended color.

getLayerTextStyleDeclarations(textStyle): Array<StyleDeclaration>

Layers with color or gradient fills affect its text styles. Returns an array of style properties from a ExtensionModels.TextStyle instance, taking fills of the layer into account.

Parameters:

Returns:

An array of StyleDeclaration.

TextStyle

constructor(textStyleObject): TextStyle

Creates an instance from an extension text style instance.

Parameters:

style: RuleSet

Returns style properties of the text style and a selector, represented by a RuleSet instance.