Partager via


ColorScheme Class

Defines the ColorScheme Class.When the object is serialized out as xml, its qualified name is a:clrScheme.

Inheritance Hierarchy

System.Object
  DocumentFormat.OpenXml.OpenXmlElement
    DocumentFormat.OpenXml.OpenXmlCompositeElement
      DocumentFormat.OpenXml.Drawing.ColorScheme

Namespace:  DocumentFormat.OpenXml.Drawing
Assembly:  DocumentFormat.OpenXml (in DocumentFormat.OpenXml.dll)

Syntax

'Declaration
<ChildElementInfoAttribute(GetType(Accent4Color))> _
<ChildElementInfoAttribute(GetType(FollowedHyperlinkColor))> _
<ChildElementInfoAttribute(GetType(ExtensionList))> _
<ChildElementInfoAttribute(GetType(Hyperlink))> _
<ChildElementInfoAttribute(GetType(Light2Color))> _
<ChildElementInfoAttribute(GetType(Dark1Color))> _
<ChildElementInfoAttribute(GetType(Light1Color))> _
<ChildElementInfoAttribute(GetType(Dark2Color))> _
<ChildElementInfoAttribute(GetType(Accent2Color))> _
<ChildElementInfoAttribute(GetType(Accent1Color))> _
<ChildElementInfoAttribute(GetType(Accent3Color))> _
<ChildElementInfoAttribute(GetType(Accent5Color))> _
<ChildElementInfoAttribute(GetType(Accent6Color))> _
Public Class ColorScheme _
    Inherits OpenXmlCompositeElement
'Usage
Dim instance As ColorScheme
[ChildElementInfoAttribute(typeof(Accent4Color))]
[ChildElementInfoAttribute(typeof(FollowedHyperlinkColor))]
[ChildElementInfoAttribute(typeof(ExtensionList))]
[ChildElementInfoAttribute(typeof(Hyperlink))]
[ChildElementInfoAttribute(typeof(Light2Color))]
[ChildElementInfoAttribute(typeof(Dark1Color))]
[ChildElementInfoAttribute(typeof(Light1Color))]
[ChildElementInfoAttribute(typeof(Dark2Color))]
[ChildElementInfoAttribute(typeof(Accent2Color))]
[ChildElementInfoAttribute(typeof(Accent1Color))]
[ChildElementInfoAttribute(typeof(Accent3Color))]
[ChildElementInfoAttribute(typeof(Accent5Color))]
[ChildElementInfoAttribute(typeof(Accent6Color))]
public class ColorScheme : OpenXmlCompositeElement

Remarks

The following table lists the possible child types:

  • Dark1Color <a:dk1>

  • Light1Color <a:lt1>

  • Dark2Color <a:dk2>

  • Light2Color <a:lt2>

  • Accent1Color <a:accent1>

  • Accent2Color <a:accent2>

  • Accent3Color <a:accent3>

  • Accent4Color <a:accent4>

  • Accent5Color <a:accent5>

  • Accent6Color <a:accent6>

  • Hyperlink <a:hlink>

  • FollowedHyperlinkColor <a:folHlink>

  • ExtensionList <a:extLst>

[ISO/IEC 29500-1 1st Edition]

20.1.6.2 clrScheme (Color Scheme)

This element defines a set of colors which are referred to as a color scheme. The color scheme is responsible for defining a list of twelve colors. The twelve colors consist of six accent colors, two dark colors, two light colors and a color for each of a hyperlink and followed hyperlink.

The Color Scheme Color elements appear in a sequence. The following listing shows the index value and corresponding Color Name.

Sequence Index

Element (Color) Name

0

dk1 (Dark 1)

1

lt1 (Light 1)

2

dk2 (Dark 2)

3

lt2 (Light 2)

4

accent1 (Accent 1)

5

accent2 (Accent 2)

6

accent3 (Accent 3)

7

accent4 (Accent 4)

8

accent5 (Accent 5)

9

accent6 (Accent 6)

10

hlink (Hyperlink)

11

folHlink (Followed Hyperlink)

[Example: Consider the following example of a color scheme defined in DrawingML:

<clrScheme name="sample">
<dk1>
<sysClr val="windowText"/>
</dk1>
  <lt1>
<sysClr val="window"/>
</lt1>
  <dk2>
<srgbClr val="04617B"/>
</dk2>
  <lt2>
<srgbClr val="DBF5F9"/>
</lt2>
  <accent1>
<srgbClr val="0F6FC6"/>
</accent1>
  <accent2>
<srgbClr val="009DD9"/>
</accent2>
  <accent3>
<srgbClr val="0BD0D9"/>
</accent3>
  <accent4>
<srgbClr val="10CF9B"/>
</accent4>
  <accent5>
<srgbClr val="7CCA62"/>
</accent5>
  <accent6>
<srgbClr val="A5C249"/>
</accent6>
  <hlink>
<srgbClr val="FF9800"/>
</hlink>
  <folHlink>
<srgbClr val="F45511"/>
</folHlink>
</clrScheme>

In this example, are defined the 12 theme colors in the sample color scheme. end example]

Parent Elements

extraClrScheme (§20.1.6.4); themeElements (§20.1.6.10); themeOverride (§20.1.6.12)

Child Elements

Subclause

accent1 (Accent 1)

§20.1.4.1.1

accent2 (Accent 2)

§20.1.4.1.2

accent3 (Accent 3)

§20.1.4.1.3

accent4 (Accent 4)

§20.1.4.1.4

accent5 (Accent 5)

§20.1.4.1.5

accent6 (Accent 6)

§20.1.4.1.6

dk1 (Dark 1)

§20.1.4.1.9

dk2 (Dark 2)

§20.1.4.1.10

extLst (Extension List)

§20.1.2.2.15

folHlink (Followed Hyperlink)

§20.1.4.1.15

hlink (Hyperlink)

§20.1.4.1.19

lt1 (Light 1)

§20.1.4.1.22

lt2 (Light 2)

§20.1.4.1.23

Attributes

Description

name (Name)

The common name for this color scheme. This name can show up in the user interface in a list of color schemes.

The possible values for this attribute are defined by the W3C XML Schema string datatype.

[Note: The W3C XML Schema definition of this element’s content model (CT_ColorScheme) is located in §A.4.1. 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.

See Also

Reference

ColorScheme Members

DocumentFormat.OpenXml.Drawing Namespace