Class DesktopBackgroundConfig
- Namespace
- SharpConsoleUI.Rendering
- Assembly
- SharpConsoleUI.dll
Configuration for the desktop background. Layers compose in order:
- Base fill (char + fg/bg from theme)
- Gradient overlay (if set)
- Pattern overlay (if set) When a gradient is active, the theme's DesktopBackgroundChar is rendered with gradient-interpolated colors. When both gradient and pattern are set, gradient colors are applied first, then pattern chars overwrite the character grid.
public sealed record DesktopBackgroundConfig : IEquatable<DesktopBackgroundConfig>
- Inheritance
-
DesktopBackgroundConfig
- Implements
- Inherited Members
- Extension Methods
Properties
AnimationIntervalMs
Animation repaint interval in milliseconds. Default: 100 (10 FPS).
public int AnimationIntervalMs { get; init; }
Property Value
BackgroundColor
Optional solid background color. Overrides theme DesktopBackgroundColor when set.
public Color? BackgroundColor { get; init; }
Property Value
Default
Creates an empty config (uses theme defaults).
public static DesktopBackgroundConfig Default { get; }
Property Value
Gradient
Optional gradient applied to the desktop. Overrides solid color.
public GradientBackground? Gradient { get; init; }
Property Value
PaintCallback
Optional callback for animated/dynamic backgrounds. Called on a timer to paint into the desktop buffer. When set, the desktop buffer is repainted at AnimationIntervalMs intervals. Parameters: (CharacterBuffer buffer, int width, int height, TimeSpan elapsed)
public Action<CharacterBuffer, int, int, TimeSpan>? PaintCallback { get; init; }
Property Value
Pattern
Optional repeating pattern rendered on top of the gradient/solid fill.
public DesktopPattern? Pattern { get; init; }
Property Value
Methods
FromColor(Color)
Creates a config with just a solid color.
public static DesktopBackgroundConfig FromColor(Color color)
Parameters
colorColor
Returns
FromGradient(ColorGradient, GradientDirection)
Creates a config with just a gradient.
public static DesktopBackgroundConfig FromGradient(ColorGradient gradient, GradientDirection direction)
Parameters
gradientColorGradientdirectionGradientDirection
Returns
FromPattern(DesktopPattern)
Creates a config with just a pattern.
public static DesktopBackgroundConfig FromPattern(DesktopPattern pattern)
Parameters
patternDesktopPattern