Siticone Logo
Siticone UI
DOCS
v2025.12.15
Docs Color Transition

Siticone Color Transition

The SiticoneColorTransition is a powerful non-visual component that animates the BackColor of any Form or Control. It smoothly interpolates between a list of colors using RGB or HSV algorithms, enabling fluid background effects, pulsing alerts, or dynamic theming.

Animation Configuration

Setup the target, timing, and color sequence for the animation.

Property Type Description & Usage Example
TargetObject Control animator.TargetObject = this.panel1; The Form or Control whose background color will be animated.
Colors List<Color> animator.Colors = new List<Color> { Color.Red, Color.Blue }; The sequence of colors to cycle through. Minimum 2 colors required.
TransitionDuration int animator.TransitionDuration = 3000; Time in milliseconds to complete a transition from one color to the next.
UpdateInterval int animator.UpdateInterval = 16; Time in milliseconds between frame updates (lower = smoother but higher CPU).

Behavior & Logic

Control interpolation modes, looping, and startup behavior.

Property Type Description & Usage Example
AutoStart bool animator.AutoStart = true; If true, animation begins automatically when the component loads.
LoopCount int animator.LoopCount = -1; Number of full cycles to run. Set to -1 for infinite looping.
InterpolationMode SiticoneInterpolationMode animator.InterpolationMode = SiticoneInterpolationMode.HSV; Calculation method: RGB (linear) or HSV (vibrant rainbows).
SmoothTransition bool animator.SmoothTransition = true; If false, colors change instantly after the duration expires instead of fading.

Performance

Optimization settings for resource-constrained environments.

Property Type Description & Usage Example
UltraFastPerformance bool animator.UltraFastPerformance = true; Disables high-frequency events and forces RGB mode to minimize CPU usage during rapid updates.

Public Methods

Programmatic control over the animation lifecycle.

Start() / Stop() / Pause() / Resume()
// Start animation from the beginning
siticoneColorTransition1.Start();

// Pause the animation at the current color
siticoneColorTransition1.Pause();

// Resume from paused state
siticoneColorTransition1.Resume();

// Stop completely (resets progress)
siticoneColorTransition1.Stop();
Colors Management
// Dynamically add a color to the cycle
siticoneColorTransition1.AddColor(Color.Purple);

// Immediately force the target to a specific color
siticoneColorTransition1.ChangeColorImmediately(Color.Red);

Events

Event Handling
// 1. AnimationStep
// Fires on every timer tick. Use for syncing other UI elements.
animator.AnimationStep += (s, e) => 
{
                Console.WriteLine($"Progress: {e.Progress:P0}");
};

// 2. LoopCompleted
// Fires when the full color list has been cycled through once.
animator.LoopCompleted += (s, e) => 
{
                Console.WriteLine($"Cycle {e.LoopCount} finished.");
};

// 3. TransitionMidpoint
// Fires halfway between two colors (50% mix).
animator.TransitionMidpoint += (s, e) => 
{
                Console.WriteLine($"Halfway between {e.StartColor} and {e.EndColor}");
};

Designer Experience

The component includes extensive Smart Tag support for quick configuration and testing.

Category Features
Animation Control Start/Stop/Reset Animation: Preview the effect directly in the Visual Studio designer.
Theme Presets One-click presets like Default, Sunset, and Ocean.
Utilities Copy/Paste Settings: Duplicate animation configurations across components.

Detailed Usage Examples

Example 1: Pulsing Alert Panel

Creates a panel that pulses red to indicate a critical error.

C# - Alert Pulse
private void StartErrorPulse(Panel alertPanel)
{
                var pulse = new SiticoneColorTransition();
    pulse.TargetObject = alertPanel;
    
                // Flash between Red and Dark Red
    pulse.Colors = new List<Color> { Color.Red, Color.DarkRed };
    
                // Fast transition for urgency
    pulse.TransitionDuration = 500; 
    pulse.AutoStart = true;
    
                this.components.Add(pulse); // Ensure disposal
}

Example 2: RGB Rainbow Border

Animates the background of a container to create a gamer-style RGB effect. Use Padding on the container to create a "border" effect around inner controls.

C# - RGB Effect
private void SetupRGBPanel(Panel container)
{
                var rgbAnim = new SiticoneColorTransition(this.components);
    rgbAnim.TargetObject = container;
    
                // Primary Colors
    rgbAnim.Colors = new List<Color> 
    { 
                Color.Red, Color.Lime, Color.Blue 
    };
    
                // Use HSV interpolation for vibrant rainbow transition
    rgbAnim.InterpolationMode = SiticoneInterpolationMode.HSV;
    rgbAnim.TransitionDuration = 2000;
    rgbAnim.Start();
}