Table of Contents

Class TransparencyBrush

Namespace
SharpConsoleUI.Rendering
Assembly
SharpConsoleUI.dll

Defines the compositing style for a transparent window, overriding the default true-transparency behavior. The brush does NOT own the color or alpha — it only controls how the compositing is performed.

public sealed record TransparencyBrush : IEquatable<TransparencyBrush>
Inheritance
TransparencyBrush
Implements
Inherited Members
Extension Methods

Properties

CompositeFunc

Per-cell compositing callback (Custom only). Receives (topCell, cellBelow, overlayAlpha) and returns the composited Cell.

public Func<Cell, Cell, byte, Cell>? CompositeFunc { get; init; }

Property Value

Func<Cell, Cell, byte, Cell>

FadeExponent

Fade exponent for character foreground (Acrylic only). Lower values = more aggressive fade. Default 0.12.

public float FadeExponent { get; init; }

Property Value

float

Style

The compositing style.

public TransparencyStyle Style { get; init; }

Property Value

TransparencyStyle

TextCoverage

Estimated text glyph coverage 0-255 for PerceivedCellColor (Acrylic/Mica). Controls how much foreground color bleeds into the perceived background. Default 90 (~35% coverage).

public byte TextCoverage { get; init; }

Property Value

byte

Methods

Acrylic(float, byte)

Creates an Acrylic brush — Gaussian bg blend + character bubble-up + configurable fade.

public static TransparencyBrush Acrylic(float fadeExponent = 0.12, byte textCoverage = 90)

Parameters

fadeExponent float
textCoverage byte

Returns

TransparencyBrush

Mica(byte)

Creates a Mica brush — Gaussian bg blend, no character bubble-up.

public static TransparencyBrush Mica(byte textCoverage = 90)

Parameters

textCoverage byte

Returns

TransparencyBrush

Tinted()

Creates a Tinted brush — simple bg-only overlay.

public static TransparencyBrush Tinted()

Returns

TransparencyBrush

WithCustom(Func<Cell, Cell, byte, Cell>)

Creates a Custom brush with a user-provided compositing function.

public static TransparencyBrush WithCustom(Func<Cell, Cell, byte, Cell> compositeFunc)

Parameters

compositeFunc Func<Cell, Cell, byte, Cell>

Returns

TransparencyBrush