NeoKolors.Tui.Core
2026.4.0-preview.4
dotnet add package NeoKolors.Tui.Core --version 2026.4.0-preview.4
NuGet\Install-Package NeoKolors.Tui.Core -Version 2026.4.0-preview.4
<PackageReference Include="NeoKolors.Tui.Core" Version="2026.4.0-preview.4" />
<PackageVersion Include="NeoKolors.Tui.Core" Version="2026.4.0-preview.4" />
<PackageReference Include="NeoKolors.Tui.Core" />
paket add NeoKolors.Tui.Core --version 2026.4.0-preview.4
#r "nuget: NeoKolors.Tui.Core, 2026.4.0-preview.4"
#:package NeoKolors.Tui.Core@2026.4.0-preview.4
#addin nuget:?package=NeoKolors.Tui.Core&version=2026.4.0-preview.4&prerelease
#tool nuget:?package=NeoKolors.Tui.Core&version=2026.4.0-preview.4&prerelease
NeoKolors.Tui.Core
NeoKolors.Tui.Core provides the core double-buffered visual canvas, geometry abstractions, border
styles, and screen rendering drivers that power the NeoKolors TUI framework. It manages the
low-level visual grid of character cells, tracking styling state changes and outputting compiled
ANSI update buffers to the console.
Core Features
- Double-Buffered Grid Canvas:
- ICharCanvas & NKCharCanvas: Represent a mutable 2D grid containing character cells, styling metadata, and Z-Index depth layers. Can dynamically resize, clear, or lay out nested canvases.
- Console Render Screen:
- ICharScreen & NKCharScreen: Manage the primary terminal screen state, writing diffed grid segments into a single compiled ANSI escape stream to minimize redraw flicker.
- Customizable Borders:
- BorderStyle: Models border configurations (top, bottom, left, right sides,
and corners) with custom style attributes. Includes built-in parsers and predefined styles
(such as
Ascii,Normal,Rounded,Thick,Double,Inset, andOutset).
- BorderStyle: Models border configurations (top, bottom, left, right sides,
and corners) with custom style attributes. Includes built-in parsers and predefined styles
(such as
- Canvas Drawing Helpers:
- CharCanvasExtensions: Extends the base canvas interface to support drawing borders, rectangles, filling background areas, and styling specific regions.
- Sixel Image Support:
- Directly place pixel images (ISixelImageInfo) onto canvas layer offsets, translating pixel maps into console coordinates.
Core Types and Abstractions
1. ICharCanvas
The interface defining operations for visual grid modification:
- Width / Height / Size: Dimensions of the current canvas.
- this[x, y]: Retrieves or assigns a CellInfo object containing character and style details.
- Place (): Places sub-canvases, character grids, styled strings, or raw character codes at specific offsets and depth layers.
- PlaceSixel (): Allocates an image buffer to be drawn on terminal screens.
2. BorderStyle
Predefined styles for box borders:
GetAscii(): Prints borders using standard ASCII characters (+,-,|).GetRounded(): Uses box-drawing characters featuring rounded corners (╭,╮,╰,╯).GetThick()/GetDouble(): Pre-configured thick or double-line box margins.GetInset()/GetOutset(): Utilizes shadows and highlights to simulate 3D inset/outset framing.
Usage Examples
1. Drawing Styled Rectangles
Using drawing extensions to draw borders and fill backgrounds:
using Metriks;
using NeoKolors.Common;
using NeoKolors.Tui.Core;
// Create a visual canvas
var canvas = new NKCharCanvas(80, 24);
// Define a region and border style
var region = new Rectangle(new Point2D(5, 2), new Point2D(25, 8));
var border = BorderStyle.GetRounded(NKColor.FromRgb(0, 255, 128));
// Draw the rounded border
canvas.PlaceRectangle(region, border);
// Apply a background color to the inner area
var innerRegion = new Rectangle(new Point2D(6, 3), new Point2D(24, 7));
canvas.StyleBackground(innerRegion, NKColor.FromRgb(32, 32, 32));
2. Rendering the Screen Buffer
Setting up a screen and executing render cycles:
using Metriks;
using NeoKolors.Tui.Core;
var screenSize = new Size2D(120, 40);
var screen = new NKCharScreen(screenSize);
// Draw static text
screen.Place("NeoKolors TUI Core Engine", new Point2D(2, 1));
// Render changes to the console stream
screen.Render();
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
-
net10.0
- HasFlagExtension.Generator (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
-
net11.0
- HasFlagExtension.Generator (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
-
net8.0
- HasFlagExtension.Generator (>= 2026.4.0)
- NeoKolors.Common (>= 2026.4.0-preview.4)
- NeoKolors.Console (>= 2026.4.0-preview.4)
- NeoKolors.Extensions (>= 2026.4.0-preview.4)
- System.Text.Encodings.Web (>= 10.0.12)
NuGet packages (6)
Showing the top 5 NuGet packages that depend on NeoKolors.Tui.Core:
| Package | Downloads |
|---|---|
|
NeoKolors.Tui
Package Description |
|
|
NeoKolors.Tui.Fonts
Package Description |
|
|
NeoKolors.Tui.Elements
Package Description |
|
|
NeoKolors.Tui.Lifecycle.Apps
Package Description |
|
|
NeoKolors.Tui.Widgets
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2026.4.0-preview.4 | 78 | 11/15/2026 |
| 2026.4.0-preview.3 | 98 | 11/1/2026 |
| 2026.4.0-preview.2 | 88 | 10/30/2026 |
| 2026.4.0-preview.1 | 101 | 10/23/2026 |
| 2026.2.0-rc2.2 | 102 | 6/8/2026 |
| 2026.2.0-rc2.1 | 86 | 6/5/2026 |
| 2026.2.0-rc2 | 101 | 6/5/2026 |
| 2026.2.0-rc1 | 78 | 6/4/2026 |