Class: Shadow

fabric.Shadow

new Shadow()

Shadow class
Source:
See:

Members

(static) reOffsetsAndBlur

Regex matching shadow offsetX, offsetY and blur (ex: "2px 2px 10px rgba(0,0,0,0.2)", "rgb(0,255,0) 2px 2px")
Source:

affectStroke :Boolean

Whether the shadow should affect stroke operations
Type:
  • Boolean
Source:

blur :Number

Shadow blur
Type:
  • Number
Source:

color :String

Shadow color
Type:
  • String
Default Value:
  • rgb(0,0,0)
Source:

includeDefaultValues :Boolean

Indicates whether toObject should include default values
Type:
  • Boolean
Default Value:
  • true
Source:

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
Type:
  • Boolean
Source:

offsetX :Number

Shadow horizontal offset
Type:
  • Number
Source:

offsetY :Number

Shadow vertical offset
Type:
  • Number
Source:

Methods

initialize(optionsopt) → {fabric.Shadow}

Constructor
Parameters:
Name Type Attributes Description
options Object | String <optional>
Options object with any of color, blur, offsetX, offsetY properties or string (e.g. "rgba(0,0,0,0.2) 2px 2px 10px")
Source:
Returns:
thisArg
Type
fabric.Shadow

toObject() → {Object}

Returns object representation of a shadow
Source:
Returns:
Object representation of a shadow instance
Type
Object

toString() → {String}

Returns a string representation of an instance
Source:
See:
Returns:
Returns CSS3 text-shadow declaration
Type
String

toSVG(object) → {String}

Returns SVG representation of a shadow
Parameters:
Name Type Description
object fabric.Object
Source:
Returns:
SVG representation of a shadow
Type
String