Table of Contents

Class DesktopBackgroundConfig

Namespace
SharpConsoleUI.Rendering
Assembly
SharpConsoleUI.dll

Configuration for the desktop background. Layers compose in order:

  1. Base fill (char + fg/bg from theme)
  2. Gradient overlay (if set)
  3. 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

int

BackgroundColor

Optional solid background color. Overrides theme DesktopBackgroundColor when set.

public Color? BackgroundColor { get; init; }

Property Value

Color?

Default

Creates an empty config (uses theme defaults).

public static DesktopBackgroundConfig Default { get; }

Property Value

DesktopBackgroundConfig

Gradient

Optional gradient applied to the desktop. Overrides solid color.

public GradientBackground? Gradient { get; init; }

Property Value

GradientBackground

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

Action<CharacterBuffer, int, int, TimeSpan>

Pattern

Optional repeating pattern rendered on top of the gradient/solid fill.

public DesktopPattern? Pattern { get; init; }

Property Value

DesktopPattern

Methods

FromColor(Color)

Creates a config with just a solid color.

public static DesktopBackgroundConfig FromColor(Color color)

Parameters

color Color

Returns

DesktopBackgroundConfig

FromGradient(ColorGradient, GradientDirection)

Creates a config with just a gradient.

public static DesktopBackgroundConfig FromGradient(ColorGradient gradient, GradientDirection direction)

Parameters

gradient ColorGradient
direction GradientDirection

Returns

DesktopBackgroundConfig

FromPattern(DesktopPattern)

Creates a config with just a pattern.

public static DesktopBackgroundConfig FromPattern(DesktopPattern pattern)

Parameters

pattern DesktopPattern

Returns

DesktopBackgroundConfig