Skip to content

Shadow

Defined in: src/Shadow.ts:63

new Shadow(options?): Shadow

Defined in: src/Shadow.ts:124

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”)

Shadow

demo

new Shadow(svgAttribute): Shadow

Defined in: src/Shadow.ts:125

string

Shadow

affectStroke: boolean

Defined in: src/Shadow.ts:96

Whether the shadow should affect stroke operations


blur: number

Defined in: src/Shadow.ts:75

Shadow blur


color: string

Defined in: src/Shadow.ts:69

Shadow color


id: number

Defined in: src/Shadow.ts:114


includeDefaultValues: boolean

Defined in: src/Shadow.ts:103

Indicates whether toObject should include default values


nonScaling: boolean

Defined in: src/Shadow.ts:112

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: number

Defined in: src/Shadow.ts:82

Shadow horizontal offset


offsetY: number

Defined in: src/Shadow.ts:89

Shadow vertical offset


static ownDefaults: Partial<TClassProperties<Shadow>> = shadowDefaultValues

Defined in: src/Shadow.ts:116


static type: string = 'shadow'

Defined in: src/Shadow.ts:118

toObject(): Partial<SerializedShadowOptions>

Defined in: src/Shadow.ts:221

Returns object representation of a shadow

Partial<SerializedShadowOptions>

Object representation of a shadow instance


toString(): string

Defined in: src/Shadow.ts:157

Returns a string representation of an instance

string

Returns CSS3 text-shadow declaration

http://www.w3.org/TR/css-text-decor-3/#text-shadow


toSVG(object): string

Defined in: src/Shadow.ts:166

Returns SVG representation of a shadow

FabricObject

string

SVG representation of a shadow


static fromObject(options): Promise<Shadow>

Defined in: src/Shadow.ts:237

Partial<TClassProperties<Shadow>>

Promise<Shadow>


static parseShadow(value): object

Defined in: src/Shadow.ts:137

string

Shadow value to parse

object

Shadow object with color, offsetX, offsetY and blur

blur: number

color: string

offsetX: number

offsetY: number