# HatchBrush

## Content

[**DsPdfJS API v9.1.3**](../README)

***

[DsPdfJS API](../globals) / HatchBrush

# Class: HatchBrush

Represents a hatch brush.

## Extends

- [`Brush`](Brush)

## Constructors

### Constructor

> **new HatchBrush**(`hatchBrushProperties`): `HatchBrush`

Creates a hatch brush with specified properties.

#### Parameters

##### hatchBrushProperties

[`HatchBrushProperties`](../type-aliases/HatchBrushProperties)

The settings for creating a brush with hatch style.

#### Returns

`HatchBrush`

#### Example

```ts
const brush = new HatchBrush({
    style: HatchStyle.LargeConfetti,
    backColor: "Navy",
    foreColor: "White"
});
```

#### Overrides

`Brush.constructor`

### Constructor

> **new HatchBrush**(`om`, `hatchBrushProperties`): `HatchBrush`

Creates a hatch brush with specified properties.

#### Parameters

##### om

[`ObjectManager`](ObjectManager)

An object manager that controls the lifetime of the HatchBrush object.

##### hatchBrushProperties

[`HatchBrushProperties`](../type-aliases/HatchBrushProperties)

The settings for creating a brush with hatch style.

#### Returns

`HatchBrush`

#### Overrides

`Brush.constructor`

## Accessors

### backColor

#### Get Signature

> **get** **backColor**(): [`Color`](../type-aliases/Color)

Gets the color of spaces between the hatch lines.

##### Returns

[`Color`](../type-aliases/Color)

***

### foreColor

#### Get Signature

> **get** **foreColor**(): [`Color`](../type-aliases/Color)

Gets the color of hatch lines.

##### Returns

[`Color`](../type-aliases/Color)

***

### id

#### Get Signature

> **get** **id**(): `number`

Gets the reference to the object.

##### Returns

`number`

#### Inherited from

[`Brush`](Brush).[`id`](Brush#id)

***

### om

#### Get Signature

> **get** **om**(): [`ObjectManager`](ObjectManager)

Gets the owner [ObjectManager](ObjectManager) instance.

##### Returns

[`ObjectManager`](ObjectManager)

#### Inherited from

[`Brush`](Brush).[`om`](Brush#om)

***

### style

#### Get Signature

> **get** **style**(): [`HatchStyle`](../enumerations/HatchStyle)

Gets the hatch style of the HatchBrush.

##### Returns

[`HatchStyle`](../enumerations/HatchStyle)

***

### type

#### Get Signature

> **get** **type**(): [`BrushType`](../enumerations/BrushType)

Gets the type of the brush.

##### Returns

[`BrushType`](../enumerations/BrushType)

#### Overrides

[`Brush`](Brush).[`type`](Brush#type)

## Methods

### free()

> **free**(): `void`

Detaches the object from the [ObjectManager](ObjectManager) and deallocates its memory, if possible.

#### Returns

`void`

#### Inherited from

[`Brush`](Brush).[`free`](Brush#free)

***

### rebind()

> **rebind**(`omTo`): `void`

Rebinds the object from the current [ObjectManager](ObjectManager) to the specified one.

#### Parameters

##### omTo

[`ObjectManager`](ObjectManager)

The new [ObjectManager](ObjectManager) for the object.

#### Returns

`void`

#### Inherited from

[`Brush`](Brush).[`rebind`](Brush#rebind)
