Aspose::Words::Themes::ThemeColors Class Reference

Detailed Description

Represents the color scheme of the document theme which contains twelve colors. ThemeColors object contains six accent colors, two dark colors, two light colors and a color for each of a hyperlink and followed hyperlink.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

#include <Aspose.Words.Cpp/Themes/ThemeColors.h>

+ Inheritance diagram for Aspose::Words::Themes::ThemeColors:

Public Member Functions

Color get_Accent1 ()
 Specifies color Accent 1. More...
 
Color get_Accent2 ()
 Specifies color Accent 2. More...
 
Color get_Accent3 ()
 Specifies color Accent 3. More...
 
Color get_Accent4 ()
 Specifies color Accent 4. More...
 
Color get_Accent5 ()
 Specifies color Accent 5. More...
 
Color get_Accent6 ()
 Specifies color Accent 6. More...
 
Color get_Dark1 ()
 Specifies color Dark 1. More...
 
Color get_Dark2 ()
 Specifies color Dark 2. More...
 
Color get_FollowedHyperlink ()
 Specifies color for a clicked hyperlink. More...
 
Color get_Hyperlink ()
 Specifies color for a hyperlink. More...
 
Color get_Light1 ()
 Specifies color Light 1. More...
 
Color get_Light2 ()
 Specifies color Light 2. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_Accent1 (Color value)
 Setter for get_Accent1. More...
 
void set_Accent2 (Color value)
 Setter for get_Accent2. More...
 
void set_Accent3 (Color value)
 Setter for get_Accent3. More...
 
void set_Accent4 (Color value)
 Setter for get_Accent4. More...
 
void set_Accent5 (Color value)
 Setter for get_Accent5. More...
 
void set_Accent6 (Color value)
 Setter for get_Accent6. More...
 
void set_Dark1 (Color value)
 Setter for get_Dark1. More...
 
void set_Dark2 (Color value)
 Setter for get_Dark2. More...
 
void set_FollowedHyperlink (Color value)
 Setter for get_FollowedHyperlink. More...
 
void set_Hyperlink (Color value)
 Setter for get_Hyperlink. More...
 
void set_Light1 (Color value)
 Setter for get_Light1. More...
 
void set_Light2 (Color value)
 Setter for get_Light2. More...
 

Static Public Member Functions

static const TypeInfoType ()
 

Member Function Documentation

◆ get_Accent1()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent1 ( )

Specifies color Accent 1.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Accent2()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent2 ( )

Specifies color Accent 2.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Accent3()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent3 ( )

Specifies color Accent 3.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Accent4()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent4 ( )

Specifies color Accent 4.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Accent5()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent5 ( )

Specifies color Accent 5.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Accent6()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Accent6 ( )

Specifies color Accent 6.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Dark1()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Dark1 ( )

Specifies color Dark 1.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Dark2()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Dark2 ( )

Specifies color Dark 2.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_FollowedHyperlink()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_FollowedHyperlink ( )

Specifies color for a clicked hyperlink.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Hyperlink()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Hyperlink ( )

Specifies color for a hyperlink.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Light1()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Light1 ( )

Specifies color Light 1.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ get_Light2()

System::Drawing::Color Aspose::Words::Themes::ThemeColors::get_Light2 ( )

Specifies color Light 2.

Examples

Shows how to set custom colors and fonts for themes.

auto doc = MakeObject<Document>(MyDir + u"Theme colors.docx");
// The "Theme" object gives us access to the document theme, a source of default fonts and colors.
SharedPtr<Theme> theme = doc->get_Theme();
// Some styles, such as "Heading 1" and "Subtitle", will inherit these fonts.
theme->get_MajorFonts()->set_Latin(u"Courier New");
theme->get_MinorFonts()->set_Latin(u"Agency FB");
// Other languages may also have their custom fonts in this theme.
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MajorFonts()->get_EastAsian());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_ComplexScript());
ASSERT_EQ(String::Empty, theme->get_MinorFonts()->get_EastAsian());
// The "Colors" property contains the color palette from Microsoft Word,
// which appears when changing shading or font color.
// Apply custom colors to the color palette so we have easy access to them in Microsoft Word
// when we, for example, change the font color via "Home" -> "Font" -> "Font Color",
// or insert a shape, and then set a color for it via "Shape Format" -> "Shape Styles".
SharedPtr<ThemeColors> colors = theme->get_Colors();
colors->set_Light2(System::Drawing::Color::get_Khaki());
colors->set_Accent3(System::Drawing::Color::get_Yellow());
colors->set_Accent4(System::Drawing::Color::get_Gold());
// Apply custom colors to hyperlinks in their clicked and un-clicked states.
colors->set_Hyperlink(System::Drawing::Color::get_Black());
colors->set_FollowedHyperlink(System::Drawing::Color::get_Gray());
doc->Save(ArtifactsDir + u"Themes.CustomColorsAndFonts.docx");

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Themes::ThemeColors::GetType ( ) const
overridevirtual

Reimplemented from System::Object.

◆ Is()

virtual bool Aspose::Words::Themes::ThemeColors::Is ( const System::TypeInfo target) const
overridevirtual

Reimplemented from System::Object.

◆ set_Accent1()

void Aspose::Words::Themes::ThemeColors::set_Accent1 ( System::Drawing::Color  value)

◆ set_Accent2()

void Aspose::Words::Themes::ThemeColors::set_Accent2 ( System::Drawing::Color  value)

◆ set_Accent3()

void Aspose::Words::Themes::ThemeColors::set_Accent3 ( System::Drawing::Color  value)

◆ set_Accent4()

void Aspose::Words::Themes::ThemeColors::set_Accent4 ( System::Drawing::Color  value)

◆ set_Accent5()

void Aspose::Words::Themes::ThemeColors::set_Accent5 ( System::Drawing::Color  value)

◆ set_Accent6()

void Aspose::Words::Themes::ThemeColors::set_Accent6 ( System::Drawing::Color  value)

◆ set_Dark1()

void Aspose::Words::Themes::ThemeColors::set_Dark1 ( System::Drawing::Color  value)

◆ set_Dark2()

void Aspose::Words::Themes::ThemeColors::set_Dark2 ( System::Drawing::Color  value)

◆ set_FollowedHyperlink()

void Aspose::Words::Themes::ThemeColors::set_FollowedHyperlink ( System::Drawing::Color  value)

◆ set_Hyperlink()

void Aspose::Words::Themes::ThemeColors::set_Hyperlink ( System::Drawing::Color  value)

◆ set_Light1()

void Aspose::Words::Themes::ThemeColors::set_Light1 ( System::Drawing::Color  value)

◆ set_Light2()

void Aspose::Words::Themes::ThemeColors::set_Light2 ( System::Drawing::Color  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Themes::ThemeColors::Type ( )
static