BackgroundColor Class
Background Color.When the object is serialized out as xml, its qualified name is x:bgColor.
Inheritance Hierarchy
System.Object
DocumentFormat.OpenXml.OpenXmlElement
DocumentFormat.OpenXml.OpenXmlLeafElement
DocumentFormat.OpenXml.Spreadsheet.ColorType
DocumentFormat.OpenXml.Spreadsheet.BackgroundColor
Namespace: DocumentFormat.OpenXml.Spreadsheet
Assembly: DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)
Syntax
'Declaration
Public Class BackgroundColor _
Inherits ColorType
'Usage
Dim instance As BackgroundColor
public class BackgroundColor : ColorType
Remarks
[ISO/IEC 29500-1 1st Edition]
18.8.3 bgColor (Background Color)
Background color of the cell fill pattern. Cell fill patterns operate with two colors: a background color and a foreground color. These combine together to make a patterned cell fill.
Parent Elements |
---|
patternFill (§18.8.32) |
Attributes |
Description |
---|---|
auto (Automatic) |
A boolean value indicating the color is automatic and system color dependent. The possible values for this attribute are defined by the W3C XML Schema boolean datatype. |
indexed (Index) |
Indexed color value. Only used for backwards compatibility. References a color in indexedColors. The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype. |
rgb (Alpha Red Green Blue Color Value) |
Standard Alpha Red Green Blue color value (ARGB). The possible values for this attribute are defined by the ST_UnsignedIntHex simple type (§18.18.86). |
theme (Theme Color) |
A zero-based index into the <clrScheme> collection (§20.1.6.2), referencing a particular <sysClr> or <srgbClr> value expressed in the Theme part. The possible values for this attribute are defined by the W3C XML Schema unsignedInt datatype. |
tint (Tint) |
Specifies the tint value applied to the color. If tint is supplied, then it is applied to the RGB value of the color to determine the final color applied. The tint value is stored as a double from -1.0 .. 1.0, where -1.0 means 100% darken and 1.0 means 100% lighten. Also, 0.0 means no change. In loading the RGB value, it is converted to HLS where HLS values are (0..HLSMAX), where HLSMAX is currently 255. [Example: Here are some examples of how to apply tint to color: If (tint < 0) Lum’ = Lum * (1.0 + tint) For example: Lum = 200; tint = -0.5; Darken 50% Lum‘ = 200 * (0.5) => 100 For example: Lum = 200; tint = -1.0; Darken 100% (make black) Lum‘ = 200 * (1.0-1.0) => 0 If (tint > 0) Lum‘ = Lum * (1.0-tint) + (HLSMAX – HLSMAX * (1.0-tint)) For example: Lum = 100; tint = 0.75; Lighten 75% Lum‘ = 100 * (1-.75) + (HLSMAX – HLSMAX*(1-.75)) = 100 * .25 + (255 – 255 * .25) = 25 + (255 – 63) = 25 + 192 = 217 For example: Lum = 100; tint = 1.0; Lighten 100% (make white) Lum‘ = 100 * (1-1) + (HLSMAX – HLSMAX*(1-1)) = 100 * 0 + (255 – 255 * 0) = 0 + (255 – 0) = 255 end example] The possible values for this attribute are defined by the W3C XML Schema double datatype. |
[Note: The W3C XML Schema definition of this element’s content model (CT_Color) is located in §A.2. end note]
© ISO/IEC29500: 2008.
Thread Safety
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.