Class: LinearGradientElement
Hierarchy​
↳
LinearGradientElement
Constructors​
constructor​
• new LinearGradientElement(document
, node
, captureTextNodes?
)
Parameters​
Name | Type |
---|---|
document | Document |
node | HTMLElement |
captureTextNodes? | boolean |
Overrides​
Defined in​
src/Document/LinearGradientElement.ts:9
Properties​
ignoreChildTypes​
â–ª Static
Readonly
ignoreChildTypes: string
[]
Inherited from​
GradientElement.ignoreChildTypes
Defined in​
attributes​
• Readonly
attributes: Record
<string
, Property
<unknown
>> = {}
Inherited from​
Defined in​
styles​
• Readonly
styles: Record
<string
, Property
<unknown
>> = {}
Inherited from​
Defined in​
stylesSpecificity​
• Readonly
stylesSpecificity: Record
<string
, string
> = {}
Inherited from​
GradientElement.stylesSpecificity
Defined in​
animationFrozen​
• animationFrozen: boolean
= false
Inherited from​
GradientElement.animationFrozen
Defined in​
animationFrozenValue​
• animationFrozenValue: string
= ''
Inherited from​
GradientElement.animationFrozenValue
Defined in​
parent​
• parent: Element
= null
Inherited from​
Defined in​
children​
• children: Element
[] = []
Inherited from​
Defined in​
document​
• Protected
Readonly
document: Document
Inherited from​
Defined in​
node​
• Protected
Optional
Readonly
node: HTMLElement
Inherited from​
Defined in​
captureTextNodes​
• Protected
Readonly
captureTextNodes: boolean
= false
Inherited from​
GradientElement.captureTextNodes
Defined in​
attributesToInherit​
• Readonly
attributesToInherit: string
[]
Inherited from​
GradientElement.attributesToInherit
Defined in​
src/Document/GradientElement.ts:13
stops​
• Protected
Readonly
stops: StopElement
[] = []
Inherited from​
Defined in​
src/Document/GradientElement.ts:15
type​
• type: string
= 'linearGradient'
Overrides​
Defined in​
src/Document/LinearGradientElement.ts:7
Methods​
getAttribute​
â–¸ getAttribute(name
, createIfNotExists?
): Property
<unknown
>
Parameters​
Name | Type | Default value |
---|---|---|
name | string | undefined |
createIfNotExists | boolean | false |
Returns​
Property
<unknown
>
Inherited from​
Defined in​
getHrefAttribute​
â–¸ getHrefAttribute(): Property
<unknown
>
Returns​
Property
<unknown
>
Inherited from​
GradientElement.getHrefAttribute
Defined in​
getStyle​
â–¸ getStyle(name
, createIfNotExists?
, skipAncestors?
): Property
<unknown
>
Parameters​
Name | Type | Default value |
---|---|---|
name | string | undefined |
createIfNotExists | boolean | false |
skipAncestors | boolean | false |
Returns​
Property
<unknown
>
Inherited from​
Defined in​
render​
â–¸ render(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Inherited from​
Defined in​
setContext​
â–¸ setContext(_
): void
Parameters​
Name | Type |
---|---|
_ | RenderingContext2D |
Returns​
void
Inherited from​
Defined in​
applyEffects​
â–¸ Protected
applyEffects(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Inherited from​
Defined in​
clearContext​
â–¸ clearContext(_
): void
Parameters​
Name | Type |
---|---|
_ | RenderingContext2D |
Returns​
void
Inherited from​
Defined in​
renderChildren​
â–¸ renderChildren(ctx
): void
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
Returns​
void
Inherited from​
GradientElement.renderChildren
Defined in​
addChild​
â–¸ Protected
addChild(childNode
): void
Parameters​
Name | Type |
---|---|
childNode | HTMLElement | Element |
Returns​
void
Inherited from​
Defined in​
matchesSelector​
â–¸ Protected
matchesSelector(selector
): boolean
Parameters​
Name | Type |
---|---|
selector | string |
Returns​
boolean
Inherited from​
GradientElement.matchesSelector
Defined in​
addStylesFromStyleDefinition​
â–¸ addStylesFromStyleDefinition(): void
Returns​
void
Inherited from​
GradientElement.addStylesFromStyleDefinition
Defined in​
removeStyles​
â–¸ Protected
removeStyles(element
, ignoreStyles
): [string
, string
][]
Parameters​
Name | Type |
---|---|
element | Element |
ignoreStyles | string [] |
Returns​
[string
, string
][]
Inherited from​
Defined in​
restoreStyles​
â–¸ Protected
restoreStyles(element
, styles
): void
Parameters​
Name | Type |
---|---|
element | Element |
styles | [string , string ][] |
Returns​
void
Inherited from​
Defined in​
isFirstChild​
â–¸ isFirstChild(): boolean
Returns​
boolean
Inherited from​
Defined in​
getGradientUnits​
â–¸ getGradientUnits(): string
Returns​
string
Inherited from​
GradientElement.getGradientUnits
Defined in​
src/Document/GradientElement.ts:38
createGradient​
â–¸ createGradient(ctx
, element
, parentOpacityProp
): string
| CanvasGradient
| CanvasPattern
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
element | PathElement |
parentOpacityProp | Property <unknown > |
Returns​
string
| CanvasGradient
| CanvasPattern
Inherited from​
GradientElement.createGradient
Defined in​
src/Document/GradientElement.ts:42
inheritStopContainer​
â–¸ Protected
inheritStopContainer(stopsContainer
): void
Parameters​
Name | Type |
---|---|
stopsContainer | Element |
Returns​
void
Inherited from​
GradientElement.inheritStopContainer
Defined in​
src/Document/GradientElement.ts:149
addParentOpacity​
â–¸ Protected
addParentOpacity(parentOpacityProp
, color
): string
Parameters​
Name | Type |
---|---|
parentOpacityProp | Property <unknown > |
color | string |
Returns​
string
Inherited from​
GradientElement.addParentOpacity
Defined in​
src/Document/GradientElement.ts:160
getGradient​
â–¸ getGradient(ctx
, element
): CanvasGradient
Parameters​
Name | Type |
---|---|
ctx | RenderingContext2D |
element | PathElement |
Returns​
CanvasGradient