Shadow
Constructors
new Shadow()
new Shadow(
options
?):Shadow
Parameters
• 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
See
Defined in
new Shadow()
new Shadow(
svgAttribute
):Shadow
Parameters
• svgAttribute: string
Returns
Defined in
Properties
affectStroke
affectStroke:
boolean
Whether the shadow should affect stroke operations
Default
Defined in
blur
blur:
number
Shadow blur
Defined in
color
color:
string
Shadow color
Default
Defined in
id
id:
number
Defined in
includeDefaultValues
includeDefaultValues:
boolean
Indicates whether toObject should include default values
Default
Defined in
nonScaling
nonScaling:
boolean
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
Default
Defined in
offsetX
offsetX:
number
Shadow horizontal offset
Default
Defined in
offsetY
offsetY:
number
Shadow vertical offset
Default
Defined in
ownDefaults
static
ownDefaults:Partial
<TClassProperties
<Shadow
>> =shadowDefaultValues
Defined in
type
static
type:string
='shadow'
Defined in
Methods
toObject()
toObject():
Partial
<SerializedShadowOptions
>
Returns object representation of a shadow
Returns
Partial
<SerializedShadowOptions
>
Object representation of a shadow instance
Defined in
toSVG()
toSVG(
object
):string
Returns SVG representation of a shadow
Parameters
• object: FabricObject
<Partial
<FabricObjectProps
>, SerializedObjectProps
, ObjectEvents
>
Returns
string
SVG representation of a shadow
Defined in
toString()
toString():
string
Returns a string representation of an instance
Returns
string
Returns CSS3 text-shadow declaration
See
http://www.w3.org/TR/css-text-decor-3/#text-shadow
Defined in
fromObject()
static
fromObject(options
):Promise
<Shadow
>
Parameters
• options: Partial
<TClassProperties
<Shadow
>>
Returns
Promise
<Shadow
>
Defined in
parseShadow()
static
parseShadow(value
):object
Parameters
• value: string
Shadow value to parse
Returns
object
Shadow object with color, offsetX, offsetY and blur
blur
blur:
number
color
color:
string
offsetX
offsetX:
number
offsetY
offsetY:
number