Table of Contents

Class BufferGradientExtensions

Namespace
SharpConsoleUI.Drawing
Assembly
SharpConsoleUI.dll

Extension methods for gradient, pattern, and stipple fills on CharacterBuffer.

public static class BufferGradientExtensions
Inheritance
BufferGradientExtensions
Inherited Members

Methods

CheckerFill(CharacterBuffer, LayoutRect, char, char, Color, Color, Color, LayoutRect?)

Fills a rectangle with alternating characters in a checkerboard pattern.

public static void CheckerFill(this CharacterBuffer buffer, LayoutRect rect, char ch1, char ch2, Color fg1, Color fg2, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
ch1 char
ch2 char
fg1 Color
fg2 Color
bg Color
clipRect LayoutRect?

GradientFillHorizontal(CharacterBuffer, LayoutRect, char, Color, Color, Color, LayoutRect?)

Fills a rectangle with a horizontal foreground color gradient (left to right).

public static void GradientFillHorizontal(this CharacterBuffer buffer, LayoutRect rect, char ch, Color fgStart, Color fgEnd, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
ch char
fgStart Color
fgEnd Color
bg Color
clipRect LayoutRect?

GradientFillRect(CharacterBuffer, LayoutRect, Color, Color, bool, LayoutRect?)

Fills a rectangle with a background color gradient (no visible character).

public static void GradientFillRect(this CharacterBuffer buffer, LayoutRect rect, Color bgStart, Color bgEnd, bool horizontal, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
bgStart Color
bgEnd Color
horizontal bool
clipRect LayoutRect?

GradientFillVertical(CharacterBuffer, LayoutRect, char, Color, Color, Color, LayoutRect?)

Fills a rectangle with a vertical foreground color gradient (top to bottom).

public static void GradientFillVertical(this CharacterBuffer buffer, LayoutRect rect, char ch, Color fgStart, Color fgEnd, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
ch char
fgStart Color
fgEnd Color
bg Color
clipRect LayoutRect?

PatternFill(CharacterBuffer, LayoutRect, string[], Color, Color, LayoutRect?)

Fills a rectangle with a repeating 2D character pattern. Each string in the pattern array represents one row of the repeating tile.

public static void PatternFill(this CharacterBuffer buffer, LayoutRect rect, string[] pattern, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
pattern string[]
fg Color
bg Color
clipRect LayoutRect?

StippleFill(CharacterBuffer, LayoutRect, double, Color, Color, LayoutRect?)

Fills a rectangle with a density-based stipple pattern. Density ranges from 0.0 (empty) to 1.0 (fully filled). Uses a deterministic hash for consistent results across redraws.

public static void StippleFill(this CharacterBuffer buffer, LayoutRect rect, double density, Color fg, Color bg, LayoutRect? clipRect = null)

Parameters

buffer CharacterBuffer
rect LayoutRect
density double
fg Color
bg Color
clipRect LayoutRect?