ColorFormat — Aspose.Slides FOSS for .NET API Reference

The ColorFormat class represents a color value used throughout the Slides API — for fills, lines, fonts, effects, and more. It supports RGB colors, scheme colors (theme-aware), and preset named colors.

Package: Aspose.Slides.Foss (net9.0)

using Aspose.Slides.Foss;
public class ColorFormat : IColorFormat

Properties

PropertyTypeAccessDescription
ColorTypeColorTypeReadType of color (RGB, Scheme, Preset, etc.).
ColorColor?ReadResolved ARGB color value.
PresetColorPresetColorReadPreset color name, if applicable.
SchemeColorSchemeColorReadTheme scheme color, if applicable.
RintReadRed component (0–255).
GintReadGreen component (0–255).
BintReadBlue component (0–255).
FloatRfloatReadRed component as float (0.0–1.0).
FloatGfloatReadGreen component as float (0.0–1.0).
FloatBfloatReadBlue component as float (0.0–1.0).
HuefloatReadHue value.
SaturationfloatReadSaturation value.
LuminancefloatReadLuminance value.

Usage Examples

Read Color from a Shape Fill

using Aspose.Slides.Foss;

using var prs = new Presentation("deck.pptx");
var shape = prs.Slides[0].Shapes[0];
var color = shape.FillFormat.SolidFillColor;

Console.WriteLine($"Type: {color.ColorType}");
Console.WriteLine($"RGB: ({color.R}, {color.G}, {color.B})");
Console.WriteLine($"Resolved: {color.Color}");

See Also