# DeviceNColorSpace Class

> Represents a color space with an arbitrary number of color components.

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

```java
class DeviceNColorSpace : ColorSpace
```

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

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

## Description

Represents a color space with an arbitrary number of color components. DeviceN color spaces were designed to represent color spaces containing multiple color components that correspond to the colorants of some target device. They provide greater flexibility than is possible with standard device color spaces such as DeviceCMYK or with individual Separation color spaces. For example, it is possible to create a DeviceN color space consisting of only the cyan, magenta, and yellow color components, with the black component excluded.

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

## Constructors

### DeviceNColorSpace

```java
com.datalogics.PDFL.DeviceNColorSpace.DeviceNColorSpace(java.util.List< String > names, ColorSpace alternate, Function tintTransform)
```

*constructor*

**Parameters**

- `names` (`java.util.List< String >`): the names of the colorants that the DeviceN space is intended to represent, among which may be All, or None
- `alternate` ([`ColorSpace`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/ColorSpace.md)): the alternate color space, which can be any device or CIE-based color space but not another special color space (Pattern, Indexed, Separation, or DeviceN).
- `tintTransform` ([`Function`](https://docs.datalogics.com/apdfl18/Java/APDFL18.0.5PlusP2e/class/Function.md)): function, called with the tint value and returning the corresponding color component values. That is, the number of components and the interpretation of their values depend on the alternate color space.

Create a DeviceN color space.

## 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.DeviceNColorSpace.delete(Boolean disposing)
```

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

```java
synchronized void com.datalogics.PDFL.DeviceNColorSpace.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.DeviceNColorSpace.finalize()
```

*protected*

**Returns:** `void`

### getAlternate

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

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

the alternate color space, which can be any device or CIE-based color space but not another special color space (Pattern, Indexed, Separation, or DeviceN).

### getAttributes

```java
PDFDict com.datalogics.PDFL.DeviceNColorSpace.getAttributes()
```

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

The dictionary of extended attributes associated with the color space.

### getFunction

```java
Function com.datalogics.PDFL.DeviceNColorSpace.getFunction()
```

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

A function, called with the tint value and returning the corresponding color component values. That is, the number of components and the interpretation of their values depend on the alternate color space.

### 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.

### getNames

```java
java.util.List< String > com.datalogics.PDFL.DeviceNColorSpace.getNames()
```

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

the names of the colorant that the DeviceN space is intended to represent, some of which may be All or None.

### 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.

### toString

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

**Returns:** `String`

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.
