# OdfColor

ODF RGB color serialized as `#RRGGBB`.

Struct 

`OfficeIMO.OpenDocument`

**Namespace**

`OfficeIMO.OpenDocument`

**Assembly**

`OfficeIMO.OpenDocument`

**Source revision**

`be6c300e4ab1` with working tree changes

**Source**

[OdfColor.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L9)

**Base**

`ValueType`

**Implements**

`IEquatable<OdfColor>`

**Modifiers**

sealed

ODF RGB color serialized as `#RRGGBB`.

## Inheritance

- ValueType
- OdfColor

## Guides & Samples

Authored walkthroughs and practical samples linked to this API.

- [Create and Read ODT, ODS and ODP Files](/docs/open-document/create-read/) Guide
  
  Create OpenDocument text, spreadsheet and presentation files, read their content, edit them in place, and open password-protected files.
- [Editable OpenDocument proposal](/showcase/opendocument-service-proposal/) Sample
  
  Create an ODT service proposal with styled text, acceptance conditions, assumptions and a PDF review copy. Includes the ODT and runnable C# source.
- [Workshop agenda in ODT and flat XML](/showcase/opendocument-workshop-agenda/) Sample
  
  Save one structured workshop agenda as editable ODT, inspectable FODT and a PDF review copy. Download all three formats and the generating C# source.
- [Client appointment letter](/showcase/opendocument-client-letter/) Sample
  
  Create an editable ODT client letter with a dated appointment, preparation notes, follow-up commitment and clear typography. Export a PDF copy.

## Usage

Explore 61 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 56

- Method [OdfColor.Parse](/api/open-document/officeimo-opendocument-odfcolor/#method-parse-string)
- Property [OdfGradientPattern.EndColor](/api/open-document/officeimo-opendocument-odfgradientpattern/#property-endcolor)
- Property [OdfGradientPattern.StartColor](/api/open-document/officeimo-opendocument-odfgradientpattern/#property-startcolor)
- Property [OdfShape.FillColor](/api/open-document/officeimo-opendocument-odfshape/#property-fillcolor)
- Property [OdfShape.StrokeColor](/api/open-document/officeimo-opendocument-odfshape/#property-strokecolor)
- Property [OdfStyle.BackgroundColor](/api/open-document/officeimo-opendocument-odfstyle/#property-backgroundcolor)
- Property [OdfStyle.Color](/api/open-document/officeimo-opendocument-odfstyle/#property-color)
- Property [OdfStyle.TextBackgroundColor](/api/open-document/officeimo-opendocument-odfstyle/#property-textbackgroundcolor)
- Property [OdfTabLineLeader.Color](/api/open-document/officeimo-opendocument-odftablineleader/#property-color)
- Property [OdfTextContent.BackgroundColor](/api/open-document/officeimo-opendocument-odftextcontent/#property-backgroundcolor)
- Property [OdfTextContent.Color](/api/open-document/officeimo-opendocument-odftextcontent/#property-color)
- Property [OdfTextHyperlink.BackgroundColor](/api/open-document/officeimo-opendocument-odftexthyperlink/#property-backgroundcolor)
- Property [OdfTextHyperlink.Color](/api/open-document/officeimo-opendocument-odftexthyperlink/#property-color)
- Property [OdfTextParagraph.BackgroundColor](/api/open-document/officeimo-opendocument-odftextparagraph/#property-backgroundcolor)
- Property [OdfTextParagraph.Color](/api/open-document/officeimo-opendocument-odftextparagraph/#property-color)
- Property [OdfTextRun.BackgroundColor](/api/open-document/officeimo-opendocument-odftextrun/#property-backgroundcolor)
- Property [OdfTextRun.Color](/api/open-document/officeimo-opendocument-odftextrun/#property-color)
- Property [OdgBackground.FillColor](/api/open-document/officeimo-opendocument-odgbackground/#property-fillcolor)
- Property [OdgShape.FillColor](/api/open-document/officeimo-opendocument-odgshape/#property-fillcolor)
- Property [OdgShape.StrokeColor](/api/open-document/officeimo-opendocument-odgshape/#property-strokecolor)
- Property [OdgShape.TextColor](/api/open-document/officeimo-opendocument-odgshape/#property-textcolor)
- Property [OdpEllipse.FillColor](/api/open-document/officeimo-opendocument-odpellipse/#property-fillcolor)
- Property [OdpEllipse.StrokeColor](/api/open-document/officeimo-opendocument-odpellipse/#property-strokecolor)
- Property [OdpGroup.FillColor](/api/open-document/officeimo-opendocument-odpgroup/#property-fillcolor)
- Property [OdpGroup.StrokeColor](/api/open-document/officeimo-opendocument-odpgroup/#property-strokecolor)
- Property [OdpHyperlink.BackgroundColor](/api/open-document/officeimo-opendocument-odphyperlink/#property-backgroundcolor)
- Property [OdpHyperlink.Color](/api/open-document/officeimo-opendocument-odphyperlink/#property-color)
- Property [OdpImage.FillColor](/api/open-document/officeimo-opendocument-odpimage/#property-fillcolor)
- Property [OdpImage.StrokeColor](/api/open-document/officeimo-opendocument-odpimage/#property-strokecolor)
- Property [OdpLine.FillColor](/api/open-document/officeimo-opendocument-odpline/#property-fillcolor)
- Property [OdpLine.StrokeColor](/api/open-document/officeimo-opendocument-odpline/#property-strokecolor)
- Property [OdpMasterPage.BackgroundColor](/api/open-document/officeimo-opendocument-odpmasterpage/#property-backgroundcolor)
- Property [OdpParagraph.BackgroundColor](/api/open-document/officeimo-opendocument-odpparagraph/#property-backgroundcolor)
- Property [OdpParagraph.Color](/api/open-document/officeimo-opendocument-odpparagraph/#property-color)
- Property [OdpRectangle.FillColor](/api/open-document/officeimo-opendocument-odprectangle/#property-fillcolor)
- Property [OdpRectangle.StrokeColor](/api/open-document/officeimo-opendocument-odprectangle/#property-strokecolor)
- Property [OdpRun.BackgroundColor](/api/open-document/officeimo-opendocument-odprun/#property-backgroundcolor)
- Property [OdpRun.Color](/api/open-document/officeimo-opendocument-odprun/#property-color)
- Property [OdpShape.FillColor](/api/open-document/officeimo-opendocument-odpshape/#property-fillcolor)
- Property [OdpShape.StrokeColor](/api/open-document/officeimo-opendocument-odpshape/#property-strokecolor)
- Property [OdpSlide.BackgroundColor](/api/open-document/officeimo-opendocument-odpslide/#property-backgroundcolor)
- Property [OdpTable.FillColor](/api/open-document/officeimo-opendocument-odptable/#property-fillcolor)
- Property [OdpTable.StrokeColor](/api/open-document/officeimo-opendocument-odptable/#property-strokecolor)
- Property [OdpTextBox.FillColor](/api/open-document/officeimo-opendocument-odptextbox/#property-fillcolor)
- Property [OdpTextBox.StrokeColor](/api/open-document/officeimo-opendocument-odptextbox/#property-strokecolor)
- Property [OdsCell.BackgroundColor](/api/open-document/officeimo-opendocument-odscell/#property-backgroundcolor)
- Property [OdsCell.Color](/api/open-document/officeimo-opendocument-odscell/#property-color)
- Property [OdsCellRun.BackgroundColor](/api/open-document/officeimo-opendocument-odscellrun/#property-backgroundcolor)
- Property [OdsCellRun.Color](/api/open-document/officeimo-opendocument-odscellrun/#property-color)
- Property [OdtHyperlink.BackgroundColor](/api/open-document/officeimo-opendocument-odthyperlink/#property-backgroundcolor)
- Property [OdtHyperlink.Color](/api/open-document/officeimo-opendocument-odthyperlink/#property-color)
- Property [OdtParagraph.BackgroundColor](/api/open-document/officeimo-opendocument-odtparagraph/#property-backgroundcolor)
- Property [OdtParagraph.Color](/api/open-document/officeimo-opendocument-odtparagraph/#property-color)
- Property [OdtParagraph.TextBackgroundColor](/api/open-document/officeimo-opendocument-odtparagraph/#property-textbackgroundcolor)
- Property [OdtSpan.BackgroundColor](/api/open-document/officeimo-opendocument-odtspan/#property-backgroundcolor)
- Property [OdtSpan.Color](/api/open-document/officeimo-opendocument-odtspan/#property-color)

### Accepted by parameters 5

- Method [OdfColor.Equals](/api/open-document/officeimo-opendocument-odfcolor/#method-equals-officeimo-opendocument-odfcolor) parameter `other`
- Method [OdfColor.TryParse](/api/open-document/officeimo-opendocument-odfcolor/#method-tryparse-string-officeimo-opendocument-odfcolor) parameter `color`
- Constructor [OdfGradientPattern.OdfGradientPattern](/api/open-document/officeimo-opendocument-odfgradientpattern/#constructor-ctor-officeimo-opendocument-odfgradientstyle-officeimo-opendocument-odfcolor-officeimo-opendocument-odfcolor-double-double-double-double-double-double) parameter `endColor`
- Constructor [OdfGradientPattern.OdfGradientPattern](/api/open-document/officeimo-opendocument-odfgradientpattern/#constructor-ctor-officeimo-opendocument-odfgradientstyle-officeimo-opendocument-odfcolor-officeimo-opendocument-odfcolor-double-double-double-double-double-double) parameter `startColor`
- Constructor [OdfTabLineLeader.OdfTabLineLeader](/api/open-document/officeimo-opendocument-odftablineleader/#constructor-ctor-string-string-string-nullable-officeimo-opendocument-odfcolor) parameter `color`

Filter members 

Show inherited

## Constructors

`public OdfColor(byte red, byte green, byte blue)` [#](#constructor-ctor-byte-byte-byte)

[OdfColor.cs:9](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L9)

Creates a color from red, green, and blue components.

Parameters

**red byte required**

**green byte required**

**blue byte required**

## Methods

Equals 2 overloads

`public bool Equals(OdfColor other)` [#](#method-equals-officeimo-opendocument-odfcolor)

[OdfColor.cs:41](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L41)

Indicates whether the current object is equal to another object of the same type.

Parameters

**other OfficeIMO.OpenDocument.OdfColor required**

An object to compare with this object.

Returns

`bool` true if the current object is equal to the other parameter; otherwise, false.

`public override bool Equals(object? obj)` [#](#method-equals-object)

[OdfColor.cs:43](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L43)

Indicates whether this instance and a specified object are equal.

Parameters

**obj object? required**

The object to compare with the current instance.

Returns

`bool` true if obj and this instance are the same type and represent the same value; otherwise, false.

`public override int GetHashCode()` [#](#method-gethashcode)

[OdfColor.cs:45](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L45)

Returns the hash code for this instance.

Returns

`int` A 32-bit signed integer that is the hash code for this instance.

`public static OdfColor Parse(string value)` [#](#method-parse-string)

[OdfColor.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L18)

Parses `#RRGGBB` or `RRGGBB`.

Parameters

**value string required**

Returns

`OdfColor`

`public override string ToString()` [#](#method-tostring)

[OdfColor.cs:39](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L39)

Returns the fully qualified type name of this instance.

Returns

`string` The fully qualified type name.

`public static bool TryParse(string? value, out OdfColor color)` [#](#method-tryparse-string-officeimo-opendocument-odfcolor)

[OdfColor.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/be6c300e4ab1859837b961c64fbfb2b2a1886cd0/Sources/OfficeIMO.OpenDocument/Values/OdfColor.cs#L29)

Attempts to parse #RRGGBB or RRGGBB without throwing.

Parameters

**value string? required**

**color OfficeIMO.OpenDocument.OdfColor required**

Returns

`bool`

## Inherited Methods

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

<!-- PowerForge markdown artifact sha256:CE22B0E22D64485E3B6A473129CD4784E0C98D868723E28CFD0FD8AB14E386BB -->
