# NamedColorSpace Class

> Class used to define the color space in use.

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

```java
class NamedColorSpace : ColorSpace
```

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

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

## Description

Class used to define the color space in use.

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

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

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

*protected*

**Parameters**

- `disposing` (`Boolean`)

**Returns:** `synchronized void`

### delete

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

**Returns:** `synchronized void`

### equals

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

**Parameters**

- `rhs` (`Object`)

**Returns:** `boolean`

### finalize

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

*protected*

**Returns:** `void`

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

### makeDeviceRGBA

```java
static NamedColorSpace com.datalogics.PDFL.NamedColorSpace.makeDeviceRGBA()
```

*static*

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

A new NamedColorSpace for DeviceRGBA (4 components: red, green, blue, alpha).

Creates a NamedColorSpace representing the DeviceRGBA color space.

### toString

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

**Returns:** `String`

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.
