Search Results for

    Show / Hide Table of Contents

    Interface IColor

    Namespace: IronPPT.Interfaces
    Assembly: IronPPT.dll
    Syntax
    public interface IColor

    IColor is the color contract you work through when a shape, run, or border in a presentation needs a fill or outline color. It exposes a color from several angles at once: the RGB channels (R, G, B, plus alpha A), preset and theme lookups (PresetColorValue, ThemeColorValue, SchemaColorValue, SystemColorValue), and the perceptual adjustments (Hue, Saturation, Luminance, Tint, Shade) that PowerPoint applies on top of a base value. Coding against the contract means a styling helper does not care whether the color came from a hex string, a scheme slot, or a system value.

    A developer rarely constructs the contract directly. The concrete implementor in IronPPT is Color, which is what you assign or read when setting an element's appearance. ColorType reports which representation is active so a reader can branch on RGB versus a preset, and the read-only ColorValue returns the resolved value. The RGB channels R, G, and B are each a ColorField, so a channel carries its own value and modifiers rather than a bare byte.

    Beyond the properties, the contract carries conversion helpers that save a manual computation: ToArgb packs the channels into a single integer, ToHtmlCssColorCode produces a CSS-ready string, and GetBrightness and GetLuminance return computed measures useful for contrast checks. Use those when exporting or comparing colors rather than re-deriving the math. The fine-tuning properties Tint and Shade each take a Percentage, while Complement, Inverse, and Gamma are nullable flags that toggle the corresponding transform only when set, so leaving them unset keeps the base color untouched.

    IColor color = new Color();
    color.R = new ColorField { Value = 0x1F };
    color.G = new ColorField { Value = 0x6F };
    color.B = new ColorField { Value = 0xC0 };
    string css = color.ToHtmlCssColorCode();

    The paragraph style example applies color while styling text, the add shape example sets fill colors on shapes, and the add text how-to walks through formatting runs where color is set.

    Properties

    A

    Declaration
    ColorField A { get; set; }
    Property Value
    Type Description
    ColorField

    B

    Declaration
    ColorField B { get; set; }
    Property Value
    Type Description
    ColorField

    ColorType

    Declaration
    ColorTypeValues ColorType { get; set; }
    Property Value
    Type Description
    ColorTypeValues

    ColorValue

    Declaration
    string ColorValue { get; }
    Property Value
    Type Description
    System.String

    Complement

    Declaration
    Nullable<bool> Complement { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    G

    Declaration
    ColorField G { get; set; }
    Property Value
    Type Description
    ColorField

    Gamma

    Declaration
    Nullable<bool> Gamma { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    Hue

    Declaration
    Hue Hue { get; set; }
    Property Value
    Type Description
    Hue

    Inverse

    Declaration
    Nullable<bool> Inverse { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    InverseGamma

    Declaration
    Nullable<bool> InverseGamma { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    Luminance

    Declaration
    Luminance Luminance { get; set; }
    Property Value
    Type Description
    Luminance

    PresetColorValue

    Declaration
    PresetColorValues PresetColorValue { get; }
    Property Value
    Type Description
    PresetColorValues

    R

    Declaration
    ColorField R { get; set; }
    Property Value
    Type Description
    ColorField

    Saturation

    Declaration
    Saturation Saturation { get; set; }
    Property Value
    Type Description
    Saturation

    SchemaColorValue

    Declaration
    SchemeColorValues SchemaColorValue { get; }
    Property Value
    Type Description
    SchemeColorValues

    Shade

    Declaration
    Percentage Shade { get; set; }
    Property Value
    Type Description
    Percentage

    SystemColorValue

    Declaration
    SystemColorValues SystemColorValue { get; }
    Property Value
    Type Description
    SystemColorValues

    ThemeColorValue

    Declaration
    ThemeColorValues ThemeColorValue { get; }
    Property Value
    Type Description
    ThemeColorValues

    Tint

    Declaration
    Percentage Tint { get; set; }
    Property Value
    Type Description
    Percentage

    Methods

    Equals(Object)

    Declaration
    bool Equals(object other)
    Parameters
    Type Name Description
    System.Object other
    Returns
    Type Description
    System.Boolean

    GetBrightness()

    Declaration
    double GetBrightness()
    Returns
    Type Description
    System.Double

    GetHashCode()

    Declaration
    int GetHashCode()
    Returns
    Type Description
    System.Int32

    GetLuminance()

    Declaration
    double GetLuminance()
    Returns
    Type Description
    System.Double

    ToArgb()

    Declaration
    int ToArgb()
    Returns
    Type Description
    System.Int32

    ToHtmlCssColorCode()

    Declaration
    string ToHtmlCssColorCode()
    Returns
    Type Description
    System.String

    ToString()

    Declaration
    string ToString()
    Returns
    Type Description
    System.String
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet