Shadow
Defined in: src/Shadow.ts:63
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Shadow(
options?
):Shadow
Defined in: src/Shadow.ts:118
Parameters
Section titled “Parameters”options?
Section titled “options?”Partial
<TClassProperties
<Shadow
>>
Options object with any of color, blur, offsetX, offsetY properties or string (e.g. “rgba(0,0,0,0.2) 2px 2px 10px”)
Returns
Section titled “Returns”Shadow
Constructor
Section titled “Constructor”new Shadow(
svgAttribute
):Shadow
Defined in: src/Shadow.ts:119
Parameters
Section titled “Parameters”svgAttribute
Section titled “svgAttribute”string
Returns
Section titled “Returns”Shadow
Properties
Section titled “Properties”affectStroke
Section titled “affectStroke”affectStroke:
boolean
Defined in: src/Shadow.ts:92
Whether the shadow should affect stroke operations
blur:
number
Defined in: src/Shadow.ts:74
Shadow blur
color:
string
Defined in: src/Shadow.ts:68
Shadow color
id:
number
Defined in: src/Shadow.ts:108
includeDefaultValues
Section titled “includeDefaultValues”includeDefaultValues:
boolean
Defined in: src/Shadow.ts:98
Indicates whether toObject should include default values
nonScaling
Section titled “nonScaling”nonScaling:
boolean
Defined in: src/Shadow.ts:106
When false
, the shadow will scale with the object.
When true
, the shadow’s offsetX, offsetY, and blur will not be affected by the object’s scale.
default to false
offsetX
Section titled “offsetX”offsetX:
number
Defined in: src/Shadow.ts:80
Shadow horizontal offset
offsetY
Section titled “offsetY”offsetY:
number
Defined in: src/Shadow.ts:86
Shadow vertical offset
ownDefaults
Section titled “ownDefaults”
static
ownDefaults:Partial
<TClassProperties
<Shadow
>> =shadowDefaultValues
Defined in: src/Shadow.ts:110
static
type:string
='shadow'
Defined in: src/Shadow.ts:112
Methods
Section titled “Methods”toObject()
Section titled “toObject()”toObject():
Partial
<SerializedShadowOptions
>
Defined in: src/Shadow.ts:215
Returns object representation of a shadow
Returns
Section titled “Returns”Partial
<SerializedShadowOptions
>
Object representation of a shadow instance
toString()
Section titled “toString()”toString():
string
Defined in: src/Shadow.ts:151
Returns a string representation of an instance
Returns
Section titled “Returns”string
Returns CSS3 text-shadow declaration
http://www.w3.org/TR/css-text-decor-3/#text-shadow
toSVG()
Section titled “toSVG()”toSVG(
object
):string
Defined in: src/Shadow.ts:160
Returns SVG representation of a shadow
Parameters
Section titled “Parameters”object
Section titled “object”Returns
Section titled “Returns”string
SVG representation of a shadow
fromObject()
Section titled “fromObject()”
static
fromObject(options
):Promise
<Shadow
>
Defined in: src/Shadow.ts:231
Parameters
Section titled “Parameters”options
Section titled “options”Partial
<TClassProperties
<Shadow
>>
Returns
Section titled “Returns”Promise
<Shadow
>
parseShadow()
Section titled “parseShadow()”
static
parseShadow(value
):object
Defined in: src/Shadow.ts:131
Parameters
Section titled “Parameters”string
Shadow value to parse
Returns
Section titled “Returns”object
Shadow object with color, offsetX, offsetY and blur
blur:
number
color:
string
offsetX
Section titled “offsetX”offsetX:
number
offsetY
Section titled “offsetY”offsetY:
number