---
title: LinearGradient
description: Linear gradient.
---

Linear gradient.

A linear gradient to be used in a widget.

## Properties

### colors

Colors of the gradient.

```typescript
colors: [Color]
```

The array of colors should include the same amount of elements as the gradients `locations` property.

### endPoint

Point to end the gradient.

```typescript
endPoint: Point
```

The normalized ending point of the gradient. The `endPoint` and `startPoint` together controls the direction of the gradient. The X and Y component should each range from 0 to 1. Defaults to (0, 1).

### locations

Locations of each color.

```typescript
locations: [number]
```

Each location should be a value in the range of 0 to 1 and indicates the location of each color in the gradients `colors` array.

The array of locations should include the same amount of elements as the gradients `colors` property.

### startPoint

Point to start the gradient.

```typescript
startPoint: Point
```

The normalized starting point of the gradient. The `endPoint` and `startPoint` together controls the direction of the gradient. The X and Y component should each range from 0 to 1. Defaults to (0, 1).

## Methods

<span id="-new-lineargradient" class="api-anchor"></span>

### new LinearGradient()

Constructs a linear gradient.

```typescript
new LinearGradient()
```