# ShadingPattern Class

> A shading pattern consists of a smoothly varying gradient between two colors.

- Product: Adobe PDF Library 18
- Language: Java
- Version: APDFL18.0.5PlusP2a
- HTML page: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ShadingPattern
- Version index: https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/llms.txt

```java
class ShadingPattern : Pattern
```

**Namespace:** `com::datalogics::PDFL`

**Inherits from:** [`Pattern`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Pattern.md)

**Derived classes:** [`AxialShadingPattern`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/AxialShadingPattern.md)

## Description

A shading pattern consists of a smoothly varying gradient between two colors.

**Uses types:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md), [`ColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ColorSpace.md), [`PDFObject`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PDFObject.md), [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md)

## Methods

### delete

```java
synchronized void com.datalogics.PDFL.ShadingPattern.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.ShadingPattern.delete()
```

**Returns:** `synchronized void`

### finalize

```java
void com.datalogics.PDFL.ShadingPattern.finalize()
```

*protected*

**Returns:** `void`

### getAntiAlias

```java
boolean com.datalogics.PDFL.ShadingPattern.getAntiAlias()
```

**Returns:** `boolean`

A flag indicating whether to filter the shading function to prevent aliasing artifacts.

### getBackgroundColor

```java
Color com.datalogics.PDFL.ShadingPattern.getBackgroundColor()
```

**Returns:** [`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md)

The background color of the shading pattern. This color must be in the color space of the shading pattern. If present, it is used to fill the areas that are outside the bounds of the shading object. May be NULL.

### getBoundingBox

```java
Rect com.datalogics.PDFL.ShadingPattern.getBoundingBox()
```

**Returns:** [`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md)

The bounding box of the shading. The coordinates are interpreted in the target coordinate space. If present, provides an additional, temporary clipping boundary to the shading.

### getColorSpace

```java
ColorSpace com.datalogics.PDFL.ShadingPattern.getColorSpace()
```

**Returns:** [`ColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ColorSpace.md)

The color space of a shading pattern. This space is restricted to be any space except a Pattern space.

### getPDFObject

```java
PDFObject com.datalogics.PDFL.Pattern.getPDFObject()
```

**Returns:** [`PDFObject`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/PDFObject.md)

### setAntiAlias

```java
void com.datalogics.PDFL.ShadingPattern.setAntiAlias(boolean antiAlias)
```

**Parameters**

- `antiAlias` (`boolean`)

**Returns:** `void`

A flag indicating whether to filter the shading function to prevent aliasing artifacts.

### setBackgroundColor

```java
void com.datalogics.PDFL.ShadingPattern.setBackgroundColor(Color color)
```

**Parameters**

- `color` ([`Color`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Color.md))

**Returns:** `void`

The background color of the shading pattern. This color must be in the color space of the shading pattern. If present, it is used to fill the areas that are outside the bounds of the shading object. May be NULL.

### setBoundingBox

```java
void com.datalogics.PDFL.ShadingPattern.setBoundingBox(Rect boundingBox)
```

**Parameters**

- `boundingBox` ([`Rect`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/Rect.md))

**Returns:** `void`

The bounding box of the shading. The coordinates are interpreted in the target coordinate space. If present, provides an additional, temporary clipping boundary to the shading.

### setColorSpace

```java
void com.datalogics.PDFL.ShadingPattern.setColorSpace(ColorSpace colorSpace)
```

**Parameters**

- `colorSpace` ([`ColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2a/class/ColorSpace.md))

**Returns:** `void`

The color space of a shading pattern. This space is restricted to be any space except a Pattern space.

### toString

```java
String com.datalogics.PDFL.ShadingPattern.toString()
```

**Returns:** `String`

Convert the shading pattern to a string.
