<!-- Generated by tools/SharpCell.Docs from the XML documentation comments. Do not edit; run the tool with 'generate'. -->

# CellColor

```csharp
public readonly struct CellColor
```

Namespace `SharpCell` · package `SharpCell`

A colour as Excel shows it, in sRGB. Theme and indexed colours of a file are turned into these when it is read; Excel ignores the alpha channel, so there is none. Colours compare by value.

## Constructors

<a id="ctor-byte-byte-byte"></a>
### CellColor(byte, byte, byte)

```csharp
public CellColor(byte R, byte G, byte B)
```

A colour as Excel shows it, in sRGB. Theme and indexed colours of a file are turned into these when it is read; Excel ignores the alpha channel, so there is none. Colours compare by value.

**Parameters**

- `R`: Red, 0 to 255.
- `G`: Green, 0 to 255.
- `B`: Blue, 0 to 255.

## Properties

<a id="b"></a>
### B

```csharp
public byte B { get; init; }
```

Blue, 0 to 255.

<a id="g"></a>
### G

```csharp
public byte G { get; init; }
```

Green, 0 to 255.

<a id="r"></a>
### R

```csharp
public byte R { get; init; }
```

Red, 0 to 255.

## Methods

<a id="fromrgb-int"></a>
### FromRgb(int)

```csharp
public static CellColor FromRgb(int rgb)
```

A colour from a `0xRRGGBB` number.

<a id="tostring"></a>
### ToString()

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

The colour as `#RRGGBB`.
