SharpCell

CellColor

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

CellColor(byte, byte, byte)

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

Properties

B

public byte B { get; init; }

Blue, 0 to 255.

G

public byte G { get; init; }

Green, 0 to 255.

R

public byte R { get; init; }

Red, 0 to 255.

Methods

FromRgb(int)

public static CellColor FromRgb(int rgb)

A colour from a 0xRRGGBB number.

ToString()

public override string ToString()

The colour as #RRGGBB.