---
Product: Aspose.PDF
Platform: net
Page Type: reference
Canonical URL: https://reference.aspose.org/pdf/net/SetColor
---

# SetColor

## Overview

`SetColor` is a class in Aspose.PDF FOSS for .NET.
Inherits from: `SetColorOperator`.

sc — Set color in current color space (non-stroking).

This class provides 11 methods for working with SetColor objects in .NET programs.
Available methods include: `Accept`, `IsTextShowOperator`, `SetColor`, `ToPdf`, `ToString`, `ValueEquals`, `getColor`.
All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package.
Properties: `B`, `C`, `Color`, `CommandName`, `G`, `Index`, and 4 more.

## Properties

| Name | Type | Access | Description |
|------|------|--------|-------------|
| `Color` | `double[]` | Read | Gets the color. |
| `R` | `double` | Read/Write | Gets or sets the r. |
| `G` | `double` | Read/Write | Gets or sets the g. |
| `B` | `double` | Read/Write | Gets or sets the b. |
| `C` | `double` | Read/Write | Gets or sets the c. |
| `M` | `double` | Read/Write | Gets or sets the m. |
| `Y` | `double` | Read/Write | Gets or sets the y. |
| `K` | `double` | Read/Write | Gets or sets the k. |
| `CommandName` | `string` | Read | The PDF command name (last token of the serialised form, e.g. |
| `Index` | `int` | Read/Write | 1-based position of this operator within its containing OperatorCollection. |

## Methods

| Signature | Description |
|-----------|-------------|
| `SetColor()` | Calls SetColor on this SetColor instance. |
| `SetColor(g: double)` | Sets the color value. |
| `SetColor(r: double, g: double, b: double)` | Sets the color value. |
| `SetColor(c: double, m: double, y: double, k: double)` | Sets the color value. |
| `SetColor(color: double[])` | Sets the color value. |
| `ToPdf()` | Calls ToPdf on this SetColor instance. |
| `ToString()` | Calls ToString on this SetColor instance. |
| `Accept(visitor: IOperatorSelector)` | Calls Accept on this SetColor instance. |
| `getColor()` | Calls getColor on this SetColor instance. |
| `IsTextShowOperator(op: Operator)` | True when op is a text-showing operator (Tj / TJ / ' / " — concrete subclasses of TextShowOperator). |
| `ValueEquals(op: Operator)` | True when this operator's serialised PDF form equals op's. |

## See Also

- [Aspose.PDF for .NET — Enterprise API Reference](https://reference.aspose.com/pdf/net/)