OfficeColor
OfficeIMO
Immutable literal RGBA color or theme-role reference shared by OfficeIMO packages.
Inheritance
- ValueType
- OfficeColor
Remarks
RGB byte getters and literal hexadecimal/CSS formatting project normalized channels to bytes. Use OfficeColor.ToNormalizedRgb to read the retained normalized RGB values without that projection.
Usage
Explore 426 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 206
- Property OfficeBorderSide.Color
- Method OfficeChartDrawingRenderer.GetSeriesColor
- Property OfficeChartLayout.HighLowLineColor
- Property OfficeChartPointStyle.FillColor
- Property OfficeChartPointStyle.HatchColor
- Property OfficeChartPointStyle.OutlineColor
- Method OfficeChartStyle.GetSeriesColor
- Property OfficeChartStyle.AxisColor
- Property OfficeChartStyle.AxisTitleColor
- Property OfficeChartStyle.BackgroundColor
- Property OfficeChartStyle.BorderColor
- Property OfficeChartStyle.CategoryAxisColor
- Property OfficeChartStyle.CategoryGridLineColor
- Property OfficeChartStyle.CategoryMinorGridLineColor
- Property OfficeChartStyle.DataLabelBorderColor
- Property OfficeChartStyle.DataLabelFillColor
- Property OfficeChartStyle.DataLabelTextColor
- Property OfficeChartStyle.GridLineColor
- Property OfficeChartStyle.LegendBackgroundColor
- Property OfficeChartStyle.LegendBorderColor
- Property OfficeChartStyle.LegendTextColor
- Property OfficeChartStyle.MutedTextColor
- Property OfficeChartStyle.Palette
- Property OfficeChartStyle.PlotAreaBackgroundColor
- Property OfficeChartStyle.PlotAreaBorderColor
- Property OfficeChartStyle.TextColor
- Property OfficeChartStyle.TitleColor
- Property OfficeChartStyle.ValueAxisColor
- Property OfficeChartStyle.ValueGridLineColor
- Property OfficeChartStyle.ValueMinorGridLineColor
- Property OfficeChartTrendline.Color
- Method OfficeColorSpaceConverter.FromCalibratedGray
- Method OfficeColorSpaceConverter.FromCalibratedRgb
- Method OfficeColorSpaceConverter.FromCmyk
- Method OfficeColorSpaceConverter.FromLab
- Method OfficeColorSpaceConverter.FromLinearSrgb
- Method OfficeColorSpaceConverter.FromOklab
- Method OfficeColorSpaceConverter.FromXyz
- Property OfficeDiagramStyle.ConnectorColor
- Property OfficeDiagramStyle.NodeColors
- Property OfficeDiagramStyle.NodeOutlineColor
- Property OfficeDiagramStyle.NodeTextColor
- Property OfficeDrawingRasterRenderOptions.Background
- Property OfficeDrawingSoftMask.BackdropColor
- Property OfficeDrawingText.Color
- Property OfficeDrawingText.DecorationColor
- Property OfficeGlow.Color
- Property OfficeGradientStop.Color
- Property OfficeImageExportOptions.BackgroundColor
- Property OfficeImageOptimizationRequest.JpegBackground
- Property OfficeInkStroke.Color
- Property OfficeJpegEncodeOptions.Background
- Property OfficeMathRenderOptions.BackgroundColor
- Property OfficeMathRenderOptions.Color
- Property OfficeRasterContainerInfo.Background
- Method OfficeRasterImage.GetPixel
- Method OfficeRasterRenderTarget.GetPixel
- Property OfficeRasterTextOptions.OutlineColor
- Property OfficeRasterTextOptions.ShadowColor
- Property OfficeRichTextRun.BackgroundColor
- Property OfficeRichTextRun.Color
- Property OfficeRichTextSegment.BackgroundColor
- Property OfficeRichTextSegment.Color
- Property OfficeShadow.Color
- Property OfficeShape.FillColor
- Property OfficeShape.StrokeColor
- Property OfficeTextTabLeaderStyle.BackgroundColor
- Property OfficeTextTabLeaderStyle.Color
- Property OfficeTextTabLineLeader.Color
- Method OfficeColor.FromNormalizedRgb
- Method OfficeColor.FromRgb
- Method OfficeColor.FromRgba
- Method OfficeColor.Parse
- Method OfficeColor.ParseCss
- Method OfficeColor.ParseHex
- Method OfficeColor.Resolve
- Property OfficeColor.Accent1
- Property OfficeColor.Accent2
- Property OfficeColor.Accent3
- Property OfficeColor.Accent4
- Property OfficeColor.Accent5
- Property OfficeColor.Accent6
- Property OfficeColor.AliceBlue
- Property OfficeColor.Aqua
- Property OfficeColor.Aquamarine
- Property OfficeColor.Azure
- Property OfficeColor.Background
- Property OfficeColor.Beige
- Property OfficeColor.Black
- Property OfficeColor.Blue
- Property OfficeColor.BlueViolet
- Property OfficeColor.Brown
- Property OfficeColor.Coral
- Property OfficeColor.CornflowerBlue
- Property OfficeColor.Crimson
- Property OfficeColor.Cyan
- Property OfficeColor.Danger
- Property OfficeColor.DarkBlue
- Property OfficeColor.DarkCyan
- Property OfficeColor.DarkGoldenrod
- Property OfficeColor.DarkGray
- Property OfficeColor.DarkGreen
- Property OfficeColor.DarkKhaki
- Property OfficeColor.DarkMagenta
- Property OfficeColor.DarkOliveGreen
- Property OfficeColor.DarkOrange
- Property OfficeColor.DarkRed
- Property OfficeColor.DarkSalmon
- Property OfficeColor.DarkSeaGreen
- Property OfficeColor.DarkSlateBlue
- Property OfficeColor.DeepPink
- Property OfficeColor.DimGray
- Property OfficeColor.DimGrey
- Property OfficeColor.DodgerBlue
- Property OfficeColor.ForestGreen
- Property OfficeColor.Gold
- Property OfficeColor.Goldenrod
- Property OfficeColor.Gray
- Property OfficeColor.Green
- Property OfficeColor.GreenYellow
- Property OfficeColor.Honeydew
- Property OfficeColor.HotPink
- Property OfficeColor.IndianRed
- Property OfficeColor.Indigo
- Property OfficeColor.Khaki
- Property OfficeColor.Lavender
- Property OfficeColor.LightBlue
- Property OfficeColor.LightCoral
- Property OfficeColor.LightCyan
- Property OfficeColor.LightGoldenrodYellow
- Property OfficeColor.LightGray
- Property OfficeColor.LightGreen
- Property OfficeColor.LightPink
- Property OfficeColor.LightSkyBlue
- Property OfficeColor.LightSteelBlue
- Property OfficeColor.LightYellow
- Property OfficeColor.Lime
- Property OfficeColor.Magenta
- Property OfficeColor.Maroon
- Property OfficeColor.MediumAquamarine
- Property OfficeColor.MediumPurple
- Property OfficeColor.MediumVioletRed
- Property OfficeColor.MistyRose
- Property OfficeColor.Navy
- Property OfficeColor.Olive
- Property OfficeColor.Orange
- Property OfficeColor.OrangeRed
- Property OfficeColor.Peru
- Property OfficeColor.Pink
- Property OfficeColor.Plum
- Property OfficeColor.Purple
- Property OfficeColor.RebeccaPurple
- Property OfficeColor.Red
- Property OfficeColor.SaddleBrown
- Property OfficeColor.Salmon
- Property OfficeColor.SandyBrown
- Property OfficeColor.SeaGreen
- Property OfficeColor.Silver
- Property OfficeColor.SkyBlue
- Property OfficeColor.SteelBlue
- Property OfficeColor.Success
- Property OfficeColor.Teal
- Property OfficeColor.Text
- Property OfficeColor.TextMuted
- Property OfficeColor.Transparent
- Property OfficeColor.Warning
- Property OfficeColor.Wheat
- Property OfficeColor.White
- Property OfficeColor.WhiteSmoke
- Property OfficeColor.Yellow
- Property OfficeColor.YellowGreen
- Property OfficeSeries.Color
- Property OfficeSeries.MarkerOutlineColor
- Property OfficeSeries.PointColors
- Property OfficeThemeChartStyle.AxisLineColor
- Property OfficeThemeChartStyle.AxisTextColor
- Property OfficeThemeChartStyle.GridlineColor
- Property OfficeThemeChartStyle.SeriesPalette
- Property OfficeThemeFooter.Color
- Property OfficeThemePalette.Accent1
- Property OfficeThemePalette.Accent2
- Property OfficeThemePalette.Accent3
- Property OfficeThemePalette.Accent4
- Property OfficeThemePalette.Accent5
- Property OfficeThemePalette.Accent6
- Property OfficeThemePalette.Background
- Property OfficeThemePalette.Danger
- Property OfficeThemePalette.Success
- Property OfficeThemePalette.Text
- Property OfficeThemePalette.TextMuted
- Property OfficeThemePalette.Warning
- Property OfficeThemeRule.Color
- Property OfficeThemeSurfaces.Accent1Tint
- Property OfficeThemeSurfaces.DangerFill
- Property OfficeThemeSurfaces.Rule
- Property OfficeThemeSurfaces.SuccessFill
- Property OfficeThemeSurfaces.Surface
- Property OfficeThemeSurfaces.WarningFill
- Property OfficeThemeTableStyle.BandFill
- Property OfficeThemeTableStyle.BorderColor
- Property OfficeThemeTableStyle.HeaderFill
- Property OfficeThemeTableStyle.HeaderText
- Property OfficeThemeTextStyle.HeadingColor
- Property OfficeThemeTextStyle.LinkColor
- Property OfficeThemeTextStyle.SubtitleColor
- Property OfficeThemeTextStyle.TitleColor
Accepted by parameters 220
- Constructor OfficeBorderSide.OfficeBorderSide
- Method OfficeChartLayout.WithHighLowLines
- Constructor OfficeChartPointStyle.OfficeChartPointStyle
- Constructor OfficeChartPointStyle.OfficeChartPointStyle
- Constructor OfficeChartPointStyle.OfficeChartPointStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Constructor OfficeChartStyle.OfficeChartStyle
- Method OfficeChartStyle.WithDataLabelTextColor
- Method OfficeChartStyle.WithPalette
- Constructor OfficeChartTrendline.OfficeChartTrendline
- Method OfficeColorExtensions.ToHexColor
- Constructor OfficeDiagramStyle.OfficeDiagramStyle
- Constructor OfficeDiagramStyle.OfficeDiagramStyle
- Constructor OfficeDiagramStyle.OfficeDiagramStyle
- Constructor OfficeDiagramStyle.OfficeDiagramStyle
- Method OfficeDrawing.AddBorderBox
- Method OfficeDrawing.AddClippedPositionedText
- Method OfficeDrawing.AddClippedText
- Method OfficeDrawing.AddPositionedText
- Method OfficeDrawing.AddStyledText
- Method OfficeDrawing.AddText
- Method OfficeDrawing.AddTextBehindContent
- Method OfficeDrawing.AddVerticalText
- Method OfficeDrawingRasterRenderer.Render
- Method OfficeDrawingRasterRenderer.ToPng
- Constructor OfficeDrawingSoftMask.OfficeDrawingSoftMask
- Method OfficeDrawingSoftMask.CreateWithLuminosityStandard
- Constructor OfficeDrawingText.OfficeDrawingText
- Constructor OfficeGlow.OfficeGlow
- Constructor OfficeGradientStop.OfficeGradientStop
- Method OfficeIccColorProfile.TryConvert
- Method OfficeIccColorProfile.TryConvertToDevice
- Method OfficeIccColorProfile.TrySoftProof
- Method OfficeIccColorProfile.TrySoftProof
- Method OfficeLinearGradient.DiagonalDown
- Method OfficeLinearGradient.DiagonalDown
- Method OfficeLinearGradient.FromAngle
- Method OfficeLinearGradient.FromAngle
- Method OfficeLinearGradient.Horizontal
- Method OfficeLinearGradient.Horizontal
- Method OfficeLinearGradient.Vertical
- Method OfficeLinearGradient.Vertical
- Method OfficeRadialGradient.Centered
- Method OfficeRadialGradient.Centered
- Method OfficeRasterCanvas.DrawArc
- Method OfficeRasterCanvas.DrawDashedEllipse
- Method OfficeRasterCanvas.DrawDashedLine
- Method OfficeRasterCanvas.DrawDashedPolyline
- Method OfficeRasterCanvas.DrawEllipse
- Method OfficeRasterCanvas.DrawEllipse
- Method OfficeRasterCanvas.DrawEllipse
- Method OfficeRasterCanvas.DrawHatchPatternRectangle
- Method OfficeRasterCanvas.DrawLine
- Method OfficeRasterCanvas.DrawParallelStyledLine
- Method OfficeRasterCanvas.DrawPatternedEllipse
- Method OfficeRasterCanvas.DrawPatternedLine
- Method OfficeRasterCanvas.DrawPatternedPolyline
- Method OfficeRasterCanvas.DrawPolygon
- Method OfficeRasterCanvas.DrawPolyline
- Method OfficeRasterCanvas.DrawRectangle
- Method OfficeRasterCanvas.DrawStyledEllipse
- Method OfficeRasterCanvas.DrawStyledEllipse
- Method OfficeRasterCanvas.DrawStyledLine
- Method OfficeRasterCanvas.DrawStyledPolygon
- Method OfficeRasterCanvas.DrawStyledPolyline
- Method OfficeRasterCanvas.DrawText
- Method OfficeRasterCanvas.DrawTextLine
- Method OfficeRasterCanvas.DrawTextLine
- Method OfficeRasterCanvas.DrawTextLineTransformed
- Method OfficeRasterCanvas.FillEllipse
- Method OfficeRasterCanvas.FillPolygon
- Method OfficeRasterCanvas.FillPolygonsEvenOdd
- Method OfficeRasterCanvas.FillPolygonsNonZero
- Method OfficeRasterCanvas.FillRectangle
- Method OfficeRasterFilters.Vignette
- Constructor OfficeRasterImage.OfficeRasterImage
- Method OfficeRasterImage.BlendPixel
- Method OfficeRasterImage.Fill
- Method OfficeRasterImage.SetPixel
- Constructor OfficeRasterRenderTarget.OfficeRasterRenderTarget
- Method OfficeRasterRenderTarget.BlendPixel
- Method OfficeRasterRenderTarget.Fill
- Method OfficeRasterRenderTarget.SetPixel
- Method OfficeRasterResampler.Transform
- Method OfficeRasterText.Draw
- Method OfficeRasterTransforms.Rotate
- Method OfficeRasterTransforms.Skew
- Constructor OfficeRichTextRun.OfficeRichTextRun
- Constructor OfficeRichTextRun.OfficeRichTextRun
- Constructor OfficeRichTextSegment.OfficeRichTextSegment
- Constructor OfficeRichTextSegment.OfficeRichTextSegment
- Constructor OfficeShadow.OfficeShadow
- Method OfficeSvgFormatting.AppendCircleElement
- Method OfficeSvgFormatting.AppendEllipseElement
- Method OfficeSvgFormatting.AppendHatchPatternRectangle
- Method OfficeSvgFormatting.AppendLineElement
- Method OfficeSvgFormatting.AppendPaintAttribute
- Method OfficeSvgFormatting.AppendParallelLineElements
- Method OfficeSvgFormatting.AppendPolygonElement
- Method OfficeSvgFormatting.AppendPolygonElement
- Method OfficeSvgFormatting.ToCssColor
- Method OfficeSvgFormatting.ToOpacity
- Method OfficeSvgFormatting.WriteColorAttribute
- Method OfficeTextBlockRenderer.AppendSvgStyledTextBlock
- Method OfficeTextBlockRenderer.AppendSvgStyledTextBlock
- Method OfficeTextBlockRenderer.AppendSvgTextBlock
- Method OfficeTextBlockRenderer.AppendSvgTextElement
- Method OfficeTextBlockRenderer.AppendSvgTextElement
- Method OfficeTextBlockRenderer.DrawRasterTextBlock
- Method OfficeTextBlockRenderer.DrawRasterTextBlock
- Method OfficeTextBlockRenderer.DrawRasterTextBox
- Method OfficeTextBlockRenderer.DrawRasterTextBox
- Method OfficeTextBlockRenderer.WriteSvgTextBlock
- Method OfficeTextBlockRenderer.WriteSvgTextBox
- Method OfficeTextBlockRenderer.WriteSvgTextBox
- Constructor OfficeTextTabLeaderStyle.OfficeTextTabLeaderStyle
- Constructor OfficeTextTabLeaderStyle.OfficeTextTabLeaderStyle
- Constructor OfficeTextTabLineLeader.OfficeTextTabLineLeader
- Extension method OfficeColor.ToHexColor
- Method OfficeColor.Equals
- Method OfficeColor.op_Equality
- Method OfficeColor.op_Equality
- Method OfficeColor.op_Inequality
- Method OfficeColor.op_Inequality
- Method OfficeColor.TryParse
- Method OfficeColor.TryParseCss
- Method OfficeColor.TryParseHex
- Constructor OfficeSeries.OfficeSeries
- Constructor OfficeSeries.OfficeSeries
- Constructor OfficeSeries.OfficeSeries
- Method OfficeSeries.CreateBubble
- Method OfficeSeries.CreateBubble
- Method OfficeSeries.CreateBubble
- Constructor OfficeThemeChartStyle.OfficeThemeChartStyle
- Constructor OfficeThemeChartStyle.OfficeThemeChartStyle
- Constructor OfficeThemeChartStyle.OfficeThemeChartStyle
- Constructor OfficeThemeChartStyle.OfficeThemeChartStyle
- Method OfficeThemeChartStyle.With
- Method OfficeThemeChartStyle.With
- Method OfficeThemeChartStyle.With
- Method OfficeThemeChartStyle.With
- Constructor OfficeThemeFooter.OfficeThemeFooter
- Method OfficeThemeFooter.With
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Constructor OfficeThemePalette.OfficeThemePalette
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Method OfficeThemePalette.With
- Constructor OfficeThemeRule.OfficeThemeRule
- Method OfficeThemeRule.With
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Constructor OfficeThemeSurfaces.OfficeThemeSurfaces
- Method OfficeThemeSurfaces.FromPalette
- Method OfficeThemeSurfaces.FromPalette
- Method OfficeThemeSurfaces.With
- Method OfficeThemeSurfaces.With
- Method OfficeThemeSurfaces.With
- Method OfficeThemeSurfaces.With
- Method OfficeThemeSurfaces.With
- Method OfficeThemeSurfaces.With
- Constructor OfficeThemeTableStyle.OfficeThemeTableStyle
- Constructor OfficeThemeTableStyle.OfficeThemeTableStyle
- Constructor OfficeThemeTableStyle.OfficeThemeTableStyle
- Constructor OfficeThemeTableStyle.OfficeThemeTableStyle
- Method OfficeThemeTableStyle.With
- Method OfficeThemeTableStyle.With
- Method OfficeThemeTableStyle.With
- Method OfficeThemeTableStyle.With
- Constructor OfficeThemeTextStyle.OfficeThemeTextStyle
- Constructor OfficeThemeTextStyle.OfficeThemeTextStyle
- Constructor OfficeThemeTextStyle.OfficeThemeTextStyle
- Constructor OfficeThemeTextStyle.OfficeThemeTextStyle
- Method OfficeThemeTextStyle.With
- Method OfficeThemeTextStyle.With
- Method OfficeThemeTextStyle.With
- Method OfficeThemeTextStyle.With
Constructors
public OfficeColor(byte r, byte g, byte b, byte a = 255) #Creates an RGBA color from byte channels.
Parameters
- r byte
- g byte
- b byte
- a byte = 255
Methods
public bool Equals(OfficeColor other) #Indicates whether the current object is equal to another object of the same type.
Parameters
- other OfficeIMO.OfficeColor
- 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) #Indicates whether this instance and a specified object are equal.
Parameters
- obj object?
- 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 static OfficeColor FromNormalizedRgb(double r, double g, double b, byte alpha = 255) #Creates a literal color retaining normalized RGB channels and a byte alpha channel.
Parameters
- r double
- Finite red channel in the inclusive 0..1 range.
- g double
- Finite green channel in the inclusive 0..1 range.
- b double
- Finite blue channel in the inclusive 0..1 range.
- alpha byte = 255
- Alpha byte, from 0 (transparent) to 255 (opaque).
Exceptions
ArgumentOutOfRangeException– An RGB channel is not finite or is outside 0..1.
public static OfficeColor FromRgb(byte r, byte g, byte b) #Creates an opaque color from RGB components.
Parameters
- r byte
- g byte
- b byte
Returns
OfficeColorpublic static OfficeColor FromRgba(byte r, byte g, byte b, byte a) #Creates a color from RGBA components.
Parameters
- r byte
- g byte
- b byte
- a byte
Returns
OfficeColorpublic override int GetHashCode() #Returns the hash code for this instance.
Returns
int A 32-bit signed integer that is the hash code for this instance.public static bool op_Equality(OfficeColor left, OfficeColor right) #Equality operator.
Parameters
- left OfficeIMO.OfficeColor
- right OfficeIMO.OfficeColor
Returns
boolpublic static bool op_Inequality(OfficeColor left, OfficeColor right) #Inequality operator.
Parameters
- left OfficeIMO.OfficeColor
- right OfficeIMO.OfficeColor
Returns
boolpublic static OfficeColor Parse(string value) #Parses a theme role, named color, #RRGGBB, RRGGBB, #RRGGBBAA, or RRGGBBAA.
Parameters
- value string
Returns
OfficeColorpublic static OfficeColor ParseCss(string value) #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 string
Returns
OfficeColorpublic static OfficeColor ParseHex(string value) #Parses a hexadecimal color value.
Parameters
- value string
Returns
OfficeColorpublic OfficeColor Resolve(OfficeTheme theme) #Resolves a role to a literal RGBA color using the supplied theme; literals are returned unchanged.
Parameters
- theme OfficeIMO.OfficeTheme
Returns
OfficeColorpublic string ToArgbHex() #Returns the byte projection as AARRGGBB; normalized RGB precision is not serialized.
Returns
stringpublic string ToCssColor() #Returns the byte projection as a CSS hexadecimal color using #RRGGBB or #RRGGBBAA notation.
Returns
stringpublic string ToHex() #Returns the byte projection as RRGGBBAA; normalized RGB precision is not serialized.
Returns
stringpublic ValueTuple<double, double, double> ToNormalizedRgb() #Returns literal RGB channels in the 0..1 range without projecting retained normalized values to bytes.
Returns
ValueTuple<double, double, double> The retained normalized channels, or byte channels divided by 255D for byte literals.Exceptions
InvalidOperationException– This color is an unresolved theme role.
public string ToRgbHex() #Returns the byte projection as RRGGBB; normalized RGB precision is not serialized.
Returns
stringpublic override string ToString() #Returns the fully qualified type name of this instance.
Returns
string The fully qualified type name.public static bool TryParse(string? value, out OfficeColor color) #Tries to parse a theme role, named or hexadecimal color value.
Parameters
- value string?
- color OfficeIMO.OfficeColor
Returns
boolpublic static bool TryParseCss(string? value, out OfficeColor color) #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 string?
- color OfficeIMO.OfficeColor
Returns
boolpublic static bool TryParseHex(string? value, out OfficeColor color) #Tries to parse a hexadecimal color value.
Parameters
- value string?
- color OfficeIMO.OfficeColor
Returns
boolInherited Methods
Properties
public OfficeColorRole Role { get; } #Gets the semantic role, or None for a literal.
public byte R { get; } #Red byte component, projected for normalized literals; resolve theme roles before reading.
public static OfficeColor Transparent { get; } #Gets fully transparent black (#00000000).
public static OfficeColor AliceBlue { get; } #Gets the AliceBlue named color (#F0F8FF).
public static OfficeColor Aquamarine { get; } #Gets the Aquamarine named color (#7FFFD4).
public static OfficeColor BlueViolet { get; } #Gets the BlueViolet named color (#8A2BE2).
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 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 OfficeColor.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 Goldenrod { get; } #Gets the Goldenrod named color (#DAA520).
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 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 Magenta { get; } #Gets the Magenta named color (#FF00FF).
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 OrangeRed { get; } #Gets the OrangeRed named color (#FF4500).
public static OfficeColor RebeccaPurple { get; } #Gets the RebeccaPurple named color (#663399).
public static OfficeColor SaddleBrown { get; } #Gets the SaddleBrown named color (#8B4513).
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 SkyBlue { get; } #Gets the SkyBlue named color (#87CEEB).
public static OfficeColor SteelBlue { get; } #Gets the SteelBlue named color (#4682B4).
public static OfficeColor WhiteSmoke { get; } #Gets the WhiteSmoke named color (#F5F5F5).
public static OfficeColor YellowGreen { get; } #Gets the YellowGreen named color (#9ACD32).
public bool IsThemeRole { get; } #Gets whether resolution against a theme is required.
public string? ThemeSlot { get; } #Gets the native DrawingML slot (accent1-6, dk1, dk2 or lt1), or null for a literal/status role.
public static OfficeColor Accent1 { get; } #Gets a reference to the first accent.
public static OfficeColor Accent2 { get; } #Gets a reference to the second accent.
public static OfficeColor Accent3 { get; } #Gets a reference to the third accent.
public static OfficeColor Accent4 { get; } #Gets a reference to the fourth accent.
public static OfficeColor Accent5 { get; } #Gets a reference to the fifth accent.
public static OfficeColor Accent6 { get; } #Gets a reference to the sixth accent.
public static OfficeColor Text { get; } #Gets a reference to primary text.
public static OfficeColor TextMuted { get; } #Gets a reference to muted text.
public static OfficeColor Background { get; } #Gets a reference to the background.
public static OfficeColor Success { get; } #Gets a positive-status color resolved at write time.
public static OfficeColor Warning { get; } #Gets a warning-status color resolved at write time.
public static OfficeColor Danger { get; } #Gets a danger-status color resolved at write time.
Extension Methods
public static string ToHexColor(OfficeColor color) #Converts a color to a hexadecimal RRGGBB value.
Parameters
- color OfficeIMO.OfficeColor
Returns
string