ColorFormat — Aspose.Slides FOSS for C++ API Reference

The ColorFormat class specifies a color for use in shape fills, lines, text, and effects. Colors can be expressed as RGB, preset, or scheme colors.

Namespace: Aspose::Slides::Foss

#include <Aspose/Slides/Foss/color_format.h>
class ColorFormat

Header: include/Aspose/Slides/Foss/color_format.h


IColorFormat Interface

The IColorFormat interface (from i_color_format.h) provides methods for getting and setting color values:

MethodDescription
color_type()Returns the ColorType (RGB, scheme, preset, etc.).
set_color_type(ColorType)Set the color type.
color()Returns the resolved Drawing::Color value.
set_color(const Drawing::Color&)Set the color from a Drawing::Color value.
preset_color()Returns the PresetColor value.
set_preset_color(PresetColor)Set the color as a preset named color.
scheme_color()Returns the SchemeColor value.
set_scheme_color(SchemeColor)Set the color as a theme scheme color.

To set a color from RGB components, construct a Drawing::Color and pass it to set_color():

// Set color from individual R, G, B components (0-255 each)
color_format->set_color(Drawing::Color(255, 128, 0));

SimpleColorFormat

The SimpleColorFormat class provides a simplified color interface used by fills, bullets, and 3-D effects:

PropertyDescription
color_type()The color type.
preset_color()Preset color value.
scheme_color()Scheme color value.

See Also