# Color32

> Representation of RGBA colors in 32 bit format.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<Color32>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public struct Color32 : IEquatable<Color32>, IFormattable
```

## Remarks

Each color component is a byte value with a range from 0 to 255.

Components ([Color32.r](/engine/6000.0/script-reference/unityengine/color32/r.md),[Color32.g](/engine/6000.0/script-reference/unityengine/color32/g.md),[Color32.b](/engine/6000.0/script-reference/unityengine/color32/b.md)) define a color in RGB color space. Alpha component ([Color32.a](/engine/6000.0/script-reference/unityengine/color32/a.md)) defines transparency - alpha of 255 is completely opaque, alpha of zero is completely transparent.

## Fields

| Value                                                         | Description                   |
| ------------------------------------------------------------- | ----------------------------- |
| [a](/engine/6000.0/script-reference/unityengine/color32/a.md) | Alpha component of the color. |
| [b](/engine/6000.0/script-reference/unityengine/color32/b.md) | Blue component of the color.  |
| [g](/engine/6000.0/script-reference/unityengine/color32/g.md) | Green component of the color. |
| [r](/engine/6000.0/script-reference/unityengine/color32/r.md) | Red component of the color.   |

## Constructors

| Constructor                                                                                                             | Description                                                |
| ----------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [Color32(System.Byte,System.Byte,System.Byte,System.Byte)](/engine/6000.0/script-reference/unityengine/color32/ctor.md) | Constructs a new Color32 with given r, g, b, a components. |

## Properties

| Property                                                                | Description                                                                                                        |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| [this\[\]](/engine/6000.0/script-reference/unityengine/color32/item.md) | Access the red (r), green (g), blue (b), and alpha (a) color components using \[0], \[1], \[2], \[3] respectively. |

## Methods

| Method                                                                      | Description                                |
| --------------------------------------------------------------------------- | ------------------------------------------ |
| [ToString](/engine/6000.0/script-reference/unityengine/color32/tostring.md) | Returns a formatted string for this color. |

## Static Methods

| Method                                                                                | Description                                        |
| ------------------------------------------------------------------------------------- | -------------------------------------------------- |
| [Lerp](/engine/6000.0/script-reference/unityengine/color32/lerp.md)                   | Linearly interpolates between colors a and b by t. |
| [LerpUnclamped](/engine/6000.0/script-reference/unityengine/color32/lerpunclamped.md) | Linearly interpolates between colors a and b by t. |

## Operators

| Operator                                                                      | Description                                                                                                    |
| ----------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| [Color32](/engine/6000.0/script-reference/unityengine/color32/op-implicit.md) | Color32 can be implicitly converted to and from [Color](/engine/6000.0/script-reference/unityengine/color.md). |
| [Color](/engine/6000.0/script-reference/unityengine/color32/op-implicit.md)   | Color32 can be implicitly converted to and from [Color](/engine/6000.0/script-reference/unityengine/color.md). |
