# SeparationColorSpace Class

> Defines the use of additional named colorants in a PDF document.

- Product: Adobe PDF Library 21
- Language: Modern C++
- Version: 21.4.0
- HTML page: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/SeparationColorSpace
- Version index: https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/llms.txt

```cpp
class SeparationColorSpace : ColorSpace
```

**Namespace:** `datalogics_interface`

**Inherits from:** [`ColorSpace`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ColorSpace.md)

## Description

Defines the use of additional named colorants in a PDF document.

Colorants in a separation color space are also sometimes referred to as spot colorants. The device displaying or printing the PDF document will supply an appropriate color based on the colorant included in the separation color space.

**Uses types:** [`ColorSpace`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ColorSpace.md), [`Function`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Function.md), [`PDFObject`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/PDFObject.md)

## Constructors

### SeparationColorSpace

```cpp
datalogics_interface::SeparationColorSpace::SeparationColorSpace(const std::string &name, const ColorSpace &alternate, const Function &tint_transform)
```

*constructor*

**Parameters**

- `name` (`const std::string &`): the name of the colorant that the Separation space is intended to represent, or All, or None
- `alternate` ([`const ColorSpace &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/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).
- `tint_transform` ([`const Function &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/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 separation color space.

### SeparationColorSpace

```cpp
datalogics_interface::SeparationColorSpace::SeparationColorSpace(Page &page, const Ink &ink)
```

*constructor*

**Parameters**

- `page` ([`Page &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Page.md)): the name of the colorant that the Separation space is intended to represent, or All, or None
- `ink` ([`const Ink &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/Ink.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).

Create a separation color space.

## Methods

### get_alternate

```cpp
std::unique_ptr< ColorSpace > datalogics_interface::SeparationColorSpace::get_alternate() const
```

**Returns:** [`std::unique_ptr< ColorSpace >`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ColorSpace.md)

The alternate color space.

The alternate color space.

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

### get_function

```cpp
std::unique_ptr< Function > datalogics_interface::SeparationColorSpace::get_function() const
```

**Returns:** [`std::unique_ptr< Function >`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/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.

### get_name

```cpp
std::string datalogics_interface::ColorSpace::get_name() const
```

**Returns:** `std::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.

### get_num_components

```cpp
int datalogics_interface::ColorSpace::get_num_components() const
```

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

### get_pdf_object

```cpp
std::unique_ptr< PDFObject > datalogics_interface::ColorSpace::get_pdf_object() const
```

**Returns:** [`std::unique_ptr< PDFObject >`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/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.

### get_separation_name

```cpp
std::string datalogics_interface::SeparationColorSpace::get_separation_name() const
```

**Returns:** `std::string`

The separation colorant name as a string.

The name of the colorant that the Separation space is intended to represent, or All, or None.

### get_separation_name_array

```cpp
std::vector< unsigned char > datalogics_interface::SeparationColorSpace::get_separation_name_array() const
```

**Returns:** `std::vector< unsigned char >`

A byte array containing the raw separation name.

The name of the colorant as a byte array.

The name of the colorant that the Separation space is intended to represent, or All, or None. This property is suitable for retrieving the name when the SeparationName cannot be retrieved as a string (for example, when the name contains non-Unicode characters).

### operator==

```cpp
virtual bool datalogics_interface::ColorSpace::operator==(const ColorSpace &other) const
```

**Parameters**

- `other` ([`const ColorSpace &`](https://docs.datalogics.com/apdfl21/ModernCPP/21.4.0/class/ColorSpace.md)): The ColorSpace to compare against.

**Returns:** `bool`

true if the two color spaces are equal, false otherwise.

Test for equality.

This works best for named color spaces.

More complex color spaces (such as ICCBased) do not support equality testing and will always return false.

### to_string

```cpp
std::string datalogics_interface::ColorSpace::to_string() const
```

**Returns:** `std::string`

A string describing this ColorSpace.

Convert a ColorSpace to a string representation.
