Back to Terminal Gui

Namespace Drawing

docfx/apispec/namespace-drawing.md

2.0.11013 B
Original Source

The Drawing namespace provides visual styling, color management, and drawing primitives for Terminal.Gui.

Key Types

  • Attribute - Foreground/background color and text style combination
  • Color - Terminal colors including TrueColor (24-bit) support
  • Scheme - Maps semantic visual roles to attributes
  • LineCanvas - Line drawing with automatic glyph joining
  • Thickness - Border and spacing dimensions
  • Glyphs - Standard drawing characters for UI elements

Color Support

csharp
// Named colors
Color red = Color.Red;

// TrueColor (24-bit RGB)
Color custom = new (128, 64, 255);

// Create an attribute
Attribute attr = new (Color.White, Color.Blue);

Scheme System

Schemes map semantic roles to visual attributes:

RolePurpose
NormalDefault appearance
FocusFocused view
HotNormalHotkey indicator
DisabledDisabled state

See Also