Skip to main content

Arlecchino.Rendering.Colors

Classes

TypeSummary
ContrastHow far apart two colors read, by the ratio the accessibility guidelines are written in. It runs from 1 for a color on itself to 21 for black on white.
RgbTermColorA style built from exact colors, for where the color itself is the point rather than a role in Theme. It falls back to the nearest palette color where the terminal cannot do 24-bit.
ShadeColors worked out against the background they will be read on, so a palette is written as how far apart things should read rather than as a list of colors that only suit one terminal.
TermColorA style built from the sixteen-color palette. This is what the roles on Theme are made of and what chrome should use, because those colors follow the terminal's own theme.
ThemeThe palette in use, reachable from anywhere that draws. Views pick a role here rather than a color, so swapping Theme.Palette restyles the whole application, chrome included.
ThemePaletteThe colors behind the roles in Theme. Every role has a default, so a palette that overrides two of them is a valid palette — and what it does not override is the framework's own colors, described on ThemePalette.Arlecchino.

Structs

TypeSummary
OklchA color as lightness, chroma and hue, in the space where those three come apart. Moving the lightness of an Rgb here leaves the color recognizably itself, which moving it in HSL does not.
RgbA 24-bit color. Shown exactly only where the terminal supports true color; otherwise it is mapped to the nearest palette entry — see TerminalCapabilities.

Interfaces

TypeSummary
IArlecchinoColorAnything that can style a cell. The frame writer only ever asks for IArlecchinoColor.Ansi and compares styles by reference, so hold on to instances instead of building one per cell.

Enums

TypeSummary
ColorSupportHow much color the terminal can show. Detected once at startup by TerminalCapabilities.DetectColor and used by every style when it builds its escape sequence.
TerminalColorThe sixteen ANSI colors plus the terminal's own default. Exact shades belong to the terminal theme, so chrome picks a role from Theme rather than a color here.
TextStyleText attributes a style carries on top of its colors. Combine them with |; a terminal that does not support one simply ignores it.