menu

WPF

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

    Show / Hide Table of Contents

    Interface IColorEffect

    Represents the color effect.

    Inherited Members
    IBehavior.Accumulate
    IBehavior.Additive
    IBehavior.Properties
    IBehavior.Timing
    Namespace: Syncfusion.Presentation
    Assembly: Syncfusion.Presentation.Base.dll
    Syntax
    public interface IColorEffect : IBehavior

    Properties

    By

    Get the color offset by value of animation

    Declaration
    IColorOffset By { get; }
    Property Value
    Type
    IColorOffset
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IColorEffect)
    {
    // Assign the color effect values
    IColorEffect colorEffect = (behavior as IColorEffect);
    IColorOffset byOffSet = colorEffect.By;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is color effect
    If (TypeOf behavior Is ColorEffect) Then
    'Assign the color effect values
    Dim colorEffect As ColorEffect = TryCast(behavior,ColorEffect)
    IColorOffset byOffSet = colorEffect.By
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    ColorSpace

    Get the colorspace value

    Declaration
    ColorSpace ColorSpace { get; set; }
    Property Value
    Type
    ColorSpace
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IColorEffect)
    {
    // Assign the color effect values
    IColorEffect colorEffect = (behavior as IColorEffect);
    colorEffect.ColorSpace = ColorSpace.HSL;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is color effect
    If (TypeOf behavior Is ColorEffect) Then
    'Assign the color effect values
    Dim colorEffect As ColorEffect = TryCast(behavior,ColorEffect)
    colorEffect.ColorSpace = ColorSpace.HSL
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    Direction

    Get the direction of color value

    Declaration
    ColorDirection Direction { get; set; }
    Property Value
    Type
    ColorDirection
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IColorEffect)
    {
    // Assign the color effect values
    IColorEffect colorEffect = (behavior as IColorEffect);
    colorEffect.Direction = ColorDirection.ClockWise;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is color effect
    If (TypeOf behavior Is ColorEffect) Then
    'Assign the color effect values
    Dim colorEffect As ColorEffect = TryCast(behavior,ColorEffect)
    colorEffect.Direction = ColorDirection.ClockWise;
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    From

    Get the from color value of animation

    Declaration
    IColor From { get; set; }
    Property Value
    Type
    IColor
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IColorEffect)
    {
    // Assign the color effect values
    IColorEffect colorEffect = (behavior as IColorEffect);
    IColor fromColor = colorEffect.From;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is color effect
    If (TypeOf behavior Is ColorEffect) Then
    'Assign the color effect values
    Dim colorEffect As ColorEffect = TryCast(behavior,ColorEffect)
    Dim fromColor As IColor = colorEffect.From
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()

    To

    Get the to color value of animation

    Declaration
    IColor To { get; set; }
    Property Value
    Type
    IColor
    Examples
    // Create a new presentation.
    IPresentation ppDoc = Presentation.Create();
    // Add a slide to the presentation.
    ISlide slide = ppDoc.Slides.Add(SlideLayoutType.Blank);
    // Add shape on the slide
    IShape shape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150);
    // Add animation effect on the slide with shape
    IEffect effect = ppDoc.Slides[0].Timeline.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick);
    // Get the behaviors list from the effect
    IBehaviors behaviors = effect.Behaviors;
    // Get behavior using foreach loop
    foreach (IBehavior behavior in behaviors)
    {
    if (behavior is IColorEffect)
    {
    // Assign the color effect values
    IColorEffect colorEffect = (behavior as IColorEffect);
    IColor toColor = colorEffect.To;
    break;
    }
    }
    // Save the presentation file
    ppDoc.Save("Sample.pptx");
    // Close the presentation file
    ppDoc.Close();
    'Create a new presentation
    Dim ppDoc As IPresentation = Presentation.Create()
    'Add a slide to the presentation.
    Dim slide As ISlide = ppDoc.Slides.Add(SlideLayoutType.Blank)
    'Add shape on the slide
    Dim shape As IShape = slide.Shapes.AddShape(AutoShapeType.Diamond, 150, 150, 250, 150)
    'Add animation effect on the slide with shape
    Dim effect As IEffect = ppDoc.Slides(0).TimeLine.MainSequence.AddEffect(shape, EffectType.ChangeFillColor, EffectSubtype.None, EffectTriggerType.OnClick)
    'Get the behaviors list from the effect
    Dim behaviors As IBehaviors = effect.Behaviors
    'Get behavior using foreach loop
    For Each behavior As Behavior In behaviors
    'Check condition for behavior is color effect
    If (TypeOf behavior Is ColorEffect) Then
    'Assign the color effect values
    Dim colorEffect As ColorEffect = TryCast(behavior,ColorEffect)
    Dim toColor As IColor = colorEffect.[To]
    Exit For
    End If
    Next
    'Save the presentation file
    ppDoc.Save("Sample.pptx")
    'Close the presentation file
    ppDoc.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved