# ToString

> Returns a formatted string for this color.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.7/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## ToString()

Returns a formatted string for this color.

```csharp
public override readonly string ToString()
```

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color32 color = Color.white;
        print(color.ToString("x"));
    }
}
```

## ToString(string)

Returns a formatted string for this color.

```csharp
public readonly string ToString(string format)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A numeric format string.

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color32 color = Color.white;
        print(color.ToString("x"));
    }
}
```

## ToString(string, IFormatProvider)

Returns a formatted string for this color.

```csharp
public readonly string ToString(string format, IFormatProvider formatProvider)
```

### Parameters

**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): A numeric format string.**** (\[IFormatProvider]\(https\://learn.microsoft.com/dotnet/api/system.iformatprovider)): An object that specifies culture-specific formatting.

### Returns

| Type                                                           | Description |
| -------------------------------------------------------------- | ----------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) |             |

### Examples

```csharp
using UnityEngine;

public class Example : MonoBehaviour
{
    void Start()
    {
        Color32 color = Color.white;
        print(color.ToString("x"));
    }
}
```
