Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Struct

OfficeColor

Namespace OfficeIMO.Drawing
Assembly OfficeIMO.Core
Base ValueType
Implements
IEquatable<OfficeColor>
Modifiers sealed

Small immutable RGBA color value used by OfficeIMO packages without external image dependencies.

Inheritance

  • ValueType
  • OfficeColor

Usage

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

Returned or exposed by

Accepted by parameters

Constructors

public OfficeColor(Byte r, Byte g, Byte b, Byte a = 255) #

Creates an RGBA color.

Parameters

r System.Byte requiredposition: 0
g System.Byte requiredposition: 1
b System.Byte requiredposition: 2
a System.Byte = 255 optionalposition: 3

Methods

Equals 2 overloads
public virtual Boolean Equals(OfficeColor other) #
Returns: Boolean

Parameters

other OfficeIMO.Drawing.OfficeColor requiredposition: 0
public override Boolean Equals(Object obj) #
Returns: Boolean

Parameters

obj System.Object requiredposition: 0
public static OfficeColor FromRgb(Byte r, Byte g, Byte b) #
Returns: OfficeColor

Creates an opaque color from RGB components.

Parameters

r System.Byte requiredposition: 0
g System.Byte requiredposition: 1
b System.Byte requiredposition: 2
public static OfficeColor FromRgba(Byte r, Byte g, Byte b, Byte a) #
Returns: OfficeColor

Creates a color from RGBA components.

Parameters

r System.Byte requiredposition: 0
g System.Byte requiredposition: 1
b System.Byte requiredposition: 2
a System.Byte requiredposition: 3
public override Int32 GetHashCode() #
Returns: Int32
public static Boolean op_Equality(OfficeColor left, OfficeColor right) #
Returns: Boolean

Equality operator.

Parameters

left OfficeIMO.Drawing.OfficeColor requiredposition: 0
right OfficeIMO.Drawing.OfficeColor requiredposition: 1
public static Boolean op_Inequality(OfficeColor left, OfficeColor right) #
Returns: Boolean

Inequality operator.

Parameters

left OfficeIMO.Drawing.OfficeColor requiredposition: 0
right OfficeIMO.Drawing.OfficeColor requiredposition: 1
public static OfficeColor Parse(String value) #
Returns: OfficeColor

Parses a named color, #RRGGBB, RRGGBB, #RRGGBBAA, or RRGGBBAA.

Parameters

value System.String requiredposition: 0
public static OfficeColor ParseCss(String value) #
Returns: OfficeColor

Parses a CSS named, hexadecimal, legacy, or CSS Color Level 4 color. Both legacy comma syntax and modern space/slash syntax are accepted.

Parameters

value System.String requiredposition: 0
public static OfficeColor ParseHex(String value) #
Returns: OfficeColor

Parses a hexadecimal color value.

Parameters

value System.String requiredposition: 0
public String ToArgbHex() #
Returns: String

Returns AARRGGBB.

public String ToCssColor() #
Returns: String

Returns a CSS hexadecimal color using #RRGGBB or #RRGGBBAA notation.

public String ToHex() #
Returns: String

Returns RRGGBBAA.

public String ToRgbHex() #
Returns: String

Returns RRGGBB.

public override String ToString() #
Returns: String
public static Boolean TryParse(String value, out OfficeColor color) #
Returns: Boolean

Tries to parse a named or hexadecimal color value.

Parameters

value System.String requiredposition: 0
color OfficeIMO.Drawing.OfficeColor@ requiredposition: 1
public static Boolean TryParseCss(String value, out OfficeColor color) #
Returns: Boolean

Tries to parse a CSS named, hexadecimal, legacy, or CSS Color Level 4 color. Out-of-range numeric channels are clamped as required by CSS color serialization.

Parameters

value System.String requiredposition: 0
color OfficeIMO.Drawing.OfficeColor@ requiredposition: 1
public static Boolean TryParseHex(String value, out OfficeColor color) #
Returns: Boolean

Tries to parse a hexadecimal color value.

Parameters

value System.String requiredposition: 0
color OfficeIMO.Drawing.OfficeColor@ requiredposition: 1

Properties

public Byte R { get; } #

Red component.

public Byte G { get; } #

Green component.

public Byte B { get; } #

Blue component.

public Byte A { get; } #

Alpha component.

public static OfficeColor Transparent { get; } #

Gets fully transparent black (#00000000).

public static OfficeColor AliceBlue { get; } #

Gets the AliceBlue named color (#F0F8FF).

public static OfficeColor Aqua { get; } #

Gets the Aqua named color (#00FFFF).

public static OfficeColor Aquamarine { get; } #

Gets the Aquamarine named color (#7FFFD4).

public static OfficeColor Azure { get; } #

Gets the Azure named color (#F0FFFF).

public static OfficeColor Beige { get; } #

Gets the Beige named color (#F5F5DC).

public static OfficeColor Black { get; } #

Gets the Black named color (#000000).

public static OfficeColor Blue { get; } #

Gets the Blue named color (#0000FF).

public static OfficeColor BlueViolet { get; } #

Gets the BlueViolet named color (#8A2BE2).

public static OfficeColor Brown { get; } #

Gets the Brown named color (#A52A2A).

public static OfficeColor Coral { get; } #

Gets the Coral named color (#FF7F50).

public static OfficeColor CornflowerBlue { get; } #

Gets the CornflowerBlue named color (#6495ED).

public static OfficeColor Crimson { get; } #

Gets the Crimson named color (#DC143C).

public static OfficeColor Cyan { get; } #

Gets the Cyan named color (#00FFFF).

public static OfficeColor DarkBlue { get; } #

Gets the DarkBlue named color (#00008B).

public static OfficeColor DarkCyan { get; } #

Gets the DarkCyan named color (#008B8B).

public static OfficeColor DarkGoldenrod { get; } #

Gets the DarkGoldenrod named color (#B8860B).

public static OfficeColor DarkGray { get; } #

Gets the DarkGray named color (#A9A9A9).

public static OfficeColor DarkGreen { get; } #

Gets the DarkGreen named color (#006400).

public static OfficeColor DarkKhaki { get; } #

Gets the DarkKhaki named color (#BDB76B).

public static OfficeColor DarkMagenta { get; } #

Gets the DarkMagenta named color (#8B008B).

public static OfficeColor DarkOliveGreen { get; } #

Gets the DarkOliveGreen named color (#556B2F).

public static OfficeColor DarkOrange { get; } #

Gets the DarkOrange named color (#FF8C00).

public static OfficeColor DarkRed { get; } #

Gets the DarkRed named color (#8B0000).

public static OfficeColor DarkSalmon { get; } #

Gets the DarkSalmon named color (#E9967A).

public static OfficeColor DarkSeaGreen { get; } #

Gets the DarkSeaGreen named color (#8FBC8F).

public static OfficeColor DarkSlateBlue { get; } #

Gets the DarkSlateBlue named color (#483D8B).

public static OfficeColor DeepPink { get; } #

Gets the DeepPink named color (#FF1493).

public static OfficeColor DimGray { get; } #

Gets the DimGray named color (#696969).

public static OfficeColor DimGrey { get; } #

Gets the British-spelling alias for DimGray.

public static OfficeColor DodgerBlue { get; } #

Gets the DodgerBlue named color (#1E90FF).

public static OfficeColor ForestGreen { get; } #

Gets the ForestGreen named color (#228B22).

public static OfficeColor Gold { get; } #

Gets the Gold named color (#FFD700).

public static OfficeColor Goldenrod { get; } #

Gets the Goldenrod named color (#DAA520).

public static OfficeColor Gray { get; } #

Gets the Gray named color (#808080).

public static OfficeColor Green { get; } #

Gets the Green named color (#008000).

public static OfficeColor GreenYellow { get; } #

Gets the GreenYellow named color (#ADFF2F).

public static OfficeColor Honeydew { get; } #

Gets the Honeydew named color (#F0FFF0).

public static OfficeColor HotPink { get; } #

Gets the HotPink named color (#FF69B4).

public static OfficeColor IndianRed { get; } #

Gets the IndianRed named color (#CD5C5C).

public static OfficeColor Indigo { get; } #

Gets the Indigo named color (#4B0082).

public static OfficeColor Khaki { get; } #

Gets the Khaki named color (#F0E68C).

public static OfficeColor Lavender { get; } #

Gets the Lavender named color (#E6E6FA).

public static OfficeColor LightBlue { get; } #

Gets the LightBlue named color (#ADD8E6).

public static OfficeColor LightCoral { get; } #

Gets the LightCoral named color (#F08080).

public static OfficeColor LightCyan { get; } #

Gets the LightCyan named color (#E0FFFF).

public static OfficeColor LightGoldenrodYellow { get; } #

Gets the LightGoldenrodYellow named color (#FAFAD2).

public static OfficeColor LightGray { get; } #

Gets the LightGray named color (#D3D3D3).

public static OfficeColor LightGreen { get; } #

Gets the LightGreen named color (#90EE90).

public static OfficeColor LightPink { get; } #

Gets the LightPink named color (#FFB6C1).

public static OfficeColor LightSkyBlue { get; } #

Gets the LightSkyBlue named color (#87CEFA).

public static OfficeColor LightSteelBlue { get; } #

Gets the LightSteelBlue named color (#B0C4DE).

public static OfficeColor LightYellow { get; } #

Gets the LightYellow named color (#FFFFE0).

public static OfficeColor Lime { get; } #

Gets the Lime named color (#00FF00).

public static OfficeColor Magenta { get; } #

Gets the Magenta named color (#FF00FF).

public static OfficeColor Maroon { get; } #

Gets the Maroon named color (#800000).

public static OfficeColor MediumAquamarine { get; } #

Gets the MediumAquamarine named color (#66CDAA).

public static OfficeColor MediumPurple { get; } #

Gets the MediumPurple named color (#9370DB).

public static OfficeColor MediumVioletRed { get; } #

Gets the MediumVioletRed named color (#C71585).

public static OfficeColor MistyRose { get; } #

Gets the MistyRose named color (#FFE4E1).

public static OfficeColor Navy { get; } #

Gets the Navy named color (#000080).

public static OfficeColor Olive { get; } #

Gets the Olive named color (#808000).

public static OfficeColor Orange { get; } #

Gets the Orange named color (#FFA500).

public static OfficeColor OrangeRed { get; } #

Gets the OrangeRed named color (#FF4500).

public static OfficeColor Peru { get; } #

Gets the Peru named color (#CD853F).

public static OfficeColor Pink { get; } #

Gets the Pink named color (#FFC0CB).

public static OfficeColor Plum { get; } #

Gets the Plum named color (#DDA0DD).

public static OfficeColor Purple { get; } #

Gets the Purple named color (#800080).

public static OfficeColor RebeccaPurple { get; } #

Gets the RebeccaPurple named color (#663399).

public static OfficeColor Red { get; } #

Gets the Red named color (#FF0000).

public static OfficeColor SaddleBrown { get; } #

Gets the SaddleBrown named color (#8B4513).

public static OfficeColor Salmon { get; } #

Gets the Salmon named color (#FA8072).

public static OfficeColor SandyBrown { get; } #

Gets the SandyBrown named color (#F4A460).

public static OfficeColor SeaGreen { get; } #

Gets the SeaGreen named color (#2E8B57).

public static OfficeColor Silver { get; } #

Gets the Silver named color (#C0C0C0).

public static OfficeColor SkyBlue { get; } #

Gets the SkyBlue named color (#87CEEB).

public static OfficeColor SteelBlue { get; } #

Gets the SteelBlue named color (#4682B4).

public static OfficeColor Teal { get; } #

Gets the Teal named color (#008080).

public static OfficeColor Wheat { get; } #

Gets the Wheat named color (#F5DEB3).

public static OfficeColor White { get; } #

Gets the White named color (#FFFFFF).

public static OfficeColor WhiteSmoke { get; } #

Gets the WhiteSmoke named color (#F5F5F5).

public static OfficeColor Yellow { get; } #

Gets the Yellow named color (#FFFF00).

public static OfficeColor YellowGreen { get; } #

Gets the YellowGreen named color (#9ACD32).

Extension Methods

public static String ToHexColor(OfficeColor color) #
Returns: String

Converts a color to a hexadecimal RRGGBB value.

Parameters

color OfficeIMO.Drawing.OfficeColor requiredposition: 0