#

API Documentation for: NEXT
Show: Inherited Protected Private Deprecated

# Graphics.Fill Class

Defined in: `Graphics.Fill:1904`
Module: EaselJS

Graphics command object. See beginFill and append for more information.

## Constructor

### `Graphics.Fill`

(

- `style`
- `matrix`

)

Defined in `Graphics.Fill:1904`

#### Parameters:

- `style` Object

  A valid Context2D fillStyle.

- `matrix` Matrix2D

- Index
- Methods
- Properties

## Item Index

### Methods

- bitmap
- exec
- linearGradient
- radialGradient

### Properties

- matrix
- style

## Methods

### `bitmap`

(

- `image`
- `[repetition]`

)
Fill

Defined in `bitmap:1975`

Creates a bitmap fill style and assigns it to the Fill/style:property. See beginBitmapFill for more information.

#### Parameters:

- `image` HTMLImageElement | HTMLCanvasElement | HTMLVideoElement

  Must be loaded prior to creating a bitmap fill, or the fill will be empty.

- `[repetition]` String optional

  One of: repeat, repeat-x, repeat-y, or no-repeat.

#### Returns:

Fill:

Returns this Fill object for chaining or assignment.

### `exec`

(

- `ctx`

)

Defined in `exec:1920`

#### Parameters:

- `ctx` CanvasRenderingContext2D

### `linearGradient`

(

- `colors`
- `ratios`
- `x0`
- `y0`
- `x1`
- `y1`

)
Fill

Defined in `linearGradient:1936`

Creates a linear gradient style and assigns it to Fill/style:property. See beginLinearGradientFill for more information.

#### Parameters:

- `colors` Array
- `ratios` Array
- `x0` Number
- `y0` Number
- `x1` Number
- `y1` Number

#### Returns:

Fill:

Returns this Fill object for chaining or assignment.

### `radialGradient`

(

- `colors`
- `ratios`
- `x0`
- `y0`
- `r0`
- `x1`
- `y1`
- `r1`

)
Fill

Defined in `radialGradient:1955`

Creates a radial gradient style and assigns it to Fill/style:property. See beginRadialGradientFill for more information.

#### Parameters:

- `colors` Array
- `ratios` Array
- `x0` Number
- `y0` Number
- `r0` Number
- `x1` Number
- `y1` Number
- `r1` Number

#### Returns:

Fill:

Returns this Fill object for chaining or assignment.

## Properties

### `matrix`

Matrix2D

Defined in `matrix:1916`

### `style`

Object

Defined in `style:1911`

A valid Context2D fillStyle.