menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IColor - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IColor

    Represents the ARGB (alpha, red, green, blue) color.

    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IColor

    Properties

    A

    Gets the alpha color value. Read-only.

    Declaration
    byte A { get; }
    Property Value
    Type Description
    System.Byte

    A.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //Get the transparency value of color
    byte alpha = color.A;
    //Save the presentation 
    presentation.Save("AlphaValue.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'Get the transparency value of color
    Dim alpha As Byte = color.A
    'Save the presentation 
    presentation__1.Save("AlphaValue.pptx")
    'Close the presentation
    presentation__1.Close()

    B

    Gets the blue color value. Read-only.

    Declaration
    byte B { get; }
    Property Value
    Type Description
    System.Byte

    The B.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //Get the blue color
    byte blue = color.B;
    //Save the presentation 
    presentation.Save("BlueColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'Get the blue color
    Dim blue As Byte = color.B
    'Save the presentation 
    presentation__1.Save("BlueColor.pptx")
    'Close the presentation
    presentation__1.Close()

    G

    Gets the green color value. Read-only.

    Declaration
    byte G { get; }
    Property Value
    Type Description
    System.Byte

    The G.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //Get the green color value
    byte green = color.G;
    //Save the presentation 
    presentation.Save("GreenColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'Get the green color value
    Dim green As Byte = color.G
    'Save the presentation 
    presentation__1.Save("GreenColor.pptx")
    'Close the presentation
    presentation__1.Close()

    IsEmpty

    Specifies whether this IColor structure is uninitialized. Read-only.

    Declaration
    bool IsEmpty { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is empty; otherwise, false.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //To check if it is a empty
    bool _isEmpty = color.IsEmpty;
    //Save the presentation 
    presentation.Save("Empty.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'To check if it is a empty
    Dim _isEmpty As Boolean = color.IsEmpty
    'Save the presentation 
    presentation__1.Save("Empty.pptx")
    'Close the presentation
    presentation__1.Close()

    IsKnownColor

    Gets a value indicating whether the color object is a predefined color. Predefined colors are represented by the System.Drawing.KnownColor enumeration. Read-only.

    Declaration
    bool IsKnownColor { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is known color; otherwise, false.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //To check if it is a known color
    bool _isKnownColor = color.IsKnownColor;
    //Save the presentation 
    presentation.Save("KnownColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'To check if it is a known color
    Dim _isKnownColor As Boolean = color.IsKnownColor
    'Save the presentation 
    presentation__1.Save("KnownColor.pptx")
    'Close the presentation
    presentation__1.Close()

    IsNamedColor

    Gets a value indicating whether the color object is a named color or a member of the System.Drawing.KnownColor enumeration. Read-only.

    Declaration
    bool IsNamedColor { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is named color; otherwise, false.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //To check if it is a named color
    bool _isNamedColor = color.IsNamedColor;
    //Save the presentation 
    presentation.Save("NamedColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'To check if it is a known color
    Dim _isNamedColor As Boolean = color.IsNamedColor
    'Save the presentation 
    presentation__1.Save("NamedColor.pptx")
    'Close the presentation
    presentation__1.Close()

    IsSystemColor

    Gets a value indicating whether the color object is a system color. System colors are represented by elements of the System.Drawing.KnownColor enumeration. Read-only.

    Declaration
    bool IsSystemColor { get; }
    Property Value
    Type Description
    System.Boolean

    true if this instance is system color; otherwise, false.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //To check if it is a system color
    bool _isSystemColor = color.IsSystemColor;
    //Save the presentation 
    presentation.Save("SystemColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'To check if it is a system color
    Dim _isSystemColor As Boolean = color.IsSystemColor
    'Save the presentation 
    presentation__1.Save("SystemColor.pptx")
    'Close the presentation
    presentation__1.Close()

    R

    Gets the red color value. Read-only.

    Declaration
    byte R { get; }
    Property Value
    Type Description
    System.Byte

    The R.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;       
    //Get the red color value
    byte red = color.R;
    //Save the presentation 
    presentation.Save("RedColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'Get the red color value
    Dim red As Byte = color.R
    'Save the presentation 
    presentation__1.Save("RedColor.pptx")
    'Close the presentation
    presentation__1.Close()

    SystemColor

    Gets or sets a System.Drawing.Color value.

    Declaration
    Color SystemColor { get; set; }
    Property Value
    Type Description
    System.Drawing.Color

    The System.Drawing.Color.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;
    //Set the system color by specifying the rgb values
    color.SystemColor = Color.Red;
    //Save the presentation 
    presentation.Save("SystemColor.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation.
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color__2 As IColor = background.Fill.SolidFill.Color
    'Set the system color by specifying the rgb values
    color__2.SystemColor = Color.Red
    'Save the presentation 
    presentation__1.Save("SystemColor.pptx")
    'Close the presentation
    presentation__1.Close()

    Methods

    ToArgb()

    Converts the IColor structure to 32-bit ARGB value.

    Declaration
    int ToArgb()
    Returns
    Type Description
    System.Int32

    The 32-bit ARGB value of the IColor structure.

    Examples
    //Create a new presentation.
    IPresentation presentation = Presentation.Create();
    //Add a slide to the presentation
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Create instance for slide background
    IBackground background = slide.Background;
    //Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid;
    //Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89);
    //Create instance for color 
    IColor color = background.Fill.SolidFill.Color;
    //Convert color to argb
    int argb = color.ToArgb();
    //Save the presentation 
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();      
    'Create a new presentation
    Dim presentation__1 As IPresentation = Presentation.Create()
    'Add a slide to the presentation
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Create instance for slide background
    Dim background As IBackground = slide.Background
    'Set the fill type for background as Solid fill
    background.Fill.FillType = FillType.Solid
    'Set the color to slide background
    background.Fill.SolidFill.Color = ColorObject.FromArgb(120, 23, 12, 89)
    'Create instance for color 
    Dim color As IColor = background.Fill.SolidFill.Color
    'Convert color to argb
    Dim argb As Integer = color.ToArgb()
    'Save the presentation 
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved