# ICCBasedColorSpace Class

> Works with the ICC color space.

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

```java
class ICCBasedColorSpace : ColorSpace
```

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

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

## Description

Works with the ICC color space. The International Color Consortium (ICC) developed the ICC color space in 1993 to serve as a universal standard for for printing or presenting content with digital devices, and across all operating systems and platforms.

The ICC color standard applies regardless the hardware or software involved, and is used to make sure that color images and text appear properly on a wide variety of platforms.

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

## Constructors

### ICCBasedColorSpace

```java
com.datalogics.PDFL.ICCBasedColorSpace.ICCBasedColorSpace(PDFStream iccStream)
```

*constructor*

**Parameters**

- `iccStream` ([`PDFStream`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFStream.md)): stream containing the ICC profile

Create an ICC-based color stream.

### ICCBasedColorSpace

```java
com.datalogics.PDFL.ICCBasedColorSpace.ICCBasedColorSpace(PDFStream iccStream, int nComps)
```

*constructor*

**Parameters**

- `iccStream` ([`PDFStream`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/PDFStream.md)): stream containing the ICC profile
- `nComps` (`int`): The number of components (1, 3, or 4)

Create an ICC-based color stream.

## Fields

### DEVICE_CMYK

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.DEVICE_CMYK
```

*static*

The DeviceCMYK color space, representing cyan, magenta, yellow, and black components.

### DEVICE_GRAY

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.DEVICE_GRAY
```

*static*

The DeviceGray color space, representing a single grayscale component.

### DEVICE_RGB

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.DEVICE_RGB
```

*static*

The DeviceRGB color space, representing red, green, and blue components.

### DEVICE_RGBA

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.DEVICE_RGBA
```

*static*

The DeviceRGBA color space, representing red, green, blue, and alpha components.

### LAB

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.LAB
```

*static*

The CIE-based L*a*b* color space.

### LAB_A

```java
static final ColorSpace com.datalogics.PDFL.ColorSpace.LAB_A
```

*static*

The CIE-based L*a*b* color space with an alpha component.

## Methods

### delete

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

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

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

**Returns:** `synchronized void`

### equals

```java
boolean com.datalogics.PDFL.ColorSpace.equals(Object rhs)
```

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

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

*protected*

**Returns:** `void`

### getAlternate

```java
ColorSpace com.datalogics.PDFL.ICCBasedColorSpace.getAlternate()
```

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

An alternate color space to be used in case the one specified in the stream data is not supported (for example, by applications designed for earlier versions of PDF). The alternate space may be any valid color space (except a Pattern color space) that has the number of components specified by N. If this entry is omitted and the application does not understand the ICC profile data, the color space used is DeviceGray, DeviceRGB, or DeviceCMYK, depending on whether the value of N is 1, 3, or 4, respectively.

### getName

```java
String com.datalogics.PDFL.ColorSpace.getName()
```

**Returns:** `String`

The name of the color space. A named color space may be named something like DeviceRGB. More complicated color spaces may have a name like Indexed or ICCBased.

### getNumComponents

```java
int com.datalogics.PDFL.ColorSpace.getNumComponents()
```

**Returns:** `int`

The number of color components.

The number of components in the color space. For example, DeviceGray has 1 component, DeviceRGB has 3, and DeviceCMYK has 4.

### getPDFObject

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

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

The PDFObject associated with the color space.

Get the PDFObject associated with the color space. This may be a PDFName, PDFDict, PDFStream, or PDFArray.

### getRange

```java
java.util.List< Double > com.datalogics.PDFL.ICCBasedColorSpace.getRange()
```

**Returns:** `java.util.List< Double >`

An array of 2 * NumComponents numbers [ min0 max0 min1 max1 ... ] specifying the minimum and maximum valid values of the corresponding color components. These values must match the information in the ICC profile. Default value: [ 0.0 1.0 0.0 1.0 ... ]

### getStream

```java
PDFStream com.datalogics.PDFL.ICCBasedColorSpace.getStream()
```

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

The PDFStream containing the ICC-based data and other attributes.

### setAlternate

```java
void com.datalogics.PDFL.ICCBasedColorSpace.setAlternate(ColorSpace alternate)
```

**Parameters**

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

**Returns:** `void`

An alternate color space to be used in case the one specified in the stream data is not supported (for example, by applications designed for earlier versions of PDF). The alternate space may be any valid color space (except a Pattern color space) that has the number of components specified by N. If this entry is omitted and the application does not understand the ICC profile data, the color space used is DeviceGray, DeviceRGB, or DeviceCMYK, depending on whether the value of N is 1, 3, or 4, respectively.

### setRange

```java
void com.datalogics.PDFL.ICCBasedColorSpace.setRange(java.util.List< Double > range)
```

**Parameters**

- `range` (`java.util.List< Double >`)

**Returns:** `void`

An array of 2 * NumComponents numbers [ min0 max0 min1 max1 ... ] specifying the minimum and maximum valid values of the corresponding color components. These values must match the information in the ICC profile. Default value: [ 0.0 1.0 0.0 1.0 ... ]

### toString

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

**Returns:** `String`

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.
