Class CliColorPalette
- Namespace
- ItTiger.TigerCli.Primitives
- Assembly
- ItTiger.TigerCli.dll
RGB source of truth for CliColor across the full ANSI 0–255 palette, plus the
down-conversion used to degrade a 256-color value to the nearest standard 0–15 color until a
256-color (ANSI) sink exists. Because a CliColor value equals its ANSI palette
index, every RGB is derived directly from that index (no per-name table to keep in sync).
public static class CliColorPalette
- Inheritance
-
CliColorPalette
- Inherited Members
Fields
StandardColorCount
Count of directly renderable standard colors (ANSI 0–15).
public const int StandardColorCount = 16
Field Value
Methods
GetRgb(CliColor)
Resolves the concrete RGB for any ANSI 0–255 CliColor.
public static (byte R, byte G, byte B) GetRgb(CliColor color)
Parameters
colorCliColor
Returns
Exceptions
- ArgumentOutOfRangeException
- The value is outside ANSI 0–255.
IsStandard(CliColor)
True when the color is a directly renderable standard color (ANSI 0–15).
public static bool IsStandard(CliColor color)
Parameters
colorCliColor
Returns
ToNearestStandard(CliColor)
Maps any ANSI 0–255 CliColor to the nearest standard 0–15 color by Euclidean RGB
distance. Standard colors map to themselves. Used to degrade 256-color values explicitly for
sinks that cannot yet emit 256-color escape sequences.
public static CliColor ToNearestStandard(CliColor color)
Parameters
colorCliColor