Skip to content

Shadow

Defined in: src/Shadow.ts:63

new Shadow(options?): Shadow

Defined in: src/Shadow.ts:118

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

string

Shadow

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

Defined in: src/Shadow.ts:98

Indicates whether toObject should include default values


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

Defined in: src/Shadow.ts:80

Shadow horizontal offset


offsetY: number

Defined in: src/Shadow.ts:86

Shadow vertical offset


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

Defined in: src/Shadow.ts:110


static type: string = 'shadow'

Defined in: src/Shadow.ts:112

toObject(): Partial<SerializedShadowOptions>

Defined in: src/Shadow.ts:215

Returns object representation of a shadow

Partial<SerializedShadowOptions>

Object representation of a shadow instance


toString(): string

Defined in: src/Shadow.ts:151

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

Returns SVG representation of a shadow

FabricObject

string

SVG representation of a shadow


static fromObject(options): Promise<Shadow>

Defined in: src/Shadow.ts:231

Partial<TClassProperties<Shadow>>

Promise<Shadow>


static parseShadow(value): object

Defined in: src/Shadow.ts:131

string

Shadow value to parse

object

Shadow object with color, offsetX, offsetY and blur

blur: number

color: string

offsetX: number

offsetY: number