Interface IColor
Assembly: IronPPT.dll
Syntax
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
B
Declaration
ColorField B { get; set; }
Property Value
ColorType
Declaration
ColorTypeValues ColorType { get; set; }
Property Value
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
Gamma
Declaration
Nullable<bool> Gamma { get; set; }
Property Value
| Type |
Description |
| System.Nullable<System.Boolean> |
|
Hue
Declaration
Property Value
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
PresetColorValue
Declaration
PresetColorValues PresetColorValue { get; }
Property Value
R
Declaration
ColorField R { get; set; }
Property Value
Saturation
Declaration
Saturation Saturation { get; set; }
Property Value
SchemaColorValue
Declaration
SchemeColorValues SchemaColorValue { get; }
Property Value
Shade
Declaration
Percentage Shade { get; set; }
Property Value
SystemColorValue
Declaration
SystemColorValues SystemColorValue { get; }
Property Value
ThemeColorValue
Declaration
ThemeColorValues ThemeColorValue { get; }
Property Value
Tint
Declaration
Percentage Tint { get; set; }
Property Value
Methods
Equals(Object)
Declaration
bool Equals(object other)
Parameters
| Type |
Name |
Description |
| System.Object |
other |
|
Returns
| Type |
Description |
| System.Boolean |
|
GetBrightness()
Declaration
Returns
| Type |
Description |
| System.Double |
|
GetHashCode()
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
GetLuminance()
Declaration
Returns
| Type |
Description |
| System.Double |
|
ToArgb()
Declaration
Returns
| Type |
Description |
| System.Int32 |
|
ToHtmlCssColorCode()
Declaration
string ToHtmlCssColorCode()
Returns
| Type |
Description |
| System.String |
|
ToString()
Declaration
Returns
| Type |
Description |
| System.String |
|