progressbar.terminal.base module

ANSI/SGR terminal primitives and the color model.

Defines the CSI/SGR escape-sequence helpers, the RGB/HSL/Color/ ColorGradient color model, and apply_colors, the entry point WidgetBase._apply_colors uses to turn a percentage plus foreground/background colors into a styled string.

Every non-underscore name here is re-exported by progressbar.terminal (from .base import *, no __all__), so it is part of the public progressbar.terminal surface.

progressbar.terminal.base.CLEAR_LINE: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase Line containing Cursor

progressbar.terminal.base.CLEAR_LINE_ALL: CSI = <progressbar.terminal.base.CSI object>

Erase in Line (EL)

progressbar.terminal.base.CLEAR_LINE_LEFT: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase in Line from Cursor to Beginning of Line

progressbar.terminal.base.CLEAR_LINE_RIGHT: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase in Line from Cursor to End of Line (default)

progressbar.terminal.base.CLEAR_SCREEN: CSI = <progressbar.terminal.base.CSI object>

Erase in Display (ED)

progressbar.terminal.base.CLEAR_SCREEN_ALL: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase whole screen

progressbar.terminal.base.CLEAR_SCREEN_ALL_AND_HISTORY: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase whole screen and history

progressbar.terminal.base.CLEAR_SCREEN_TILL_END: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase till end of screen

progressbar.terminal.base.CLEAR_SCREEN_TILL_START: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Erase till start of screen

progressbar.terminal.base.COLUMN: CSI = <progressbar.terminal.base.CSI object>

Cursor Character Absolute [column] (default = [row,1]) (CHA)

class progressbar.terminal.base.CSI(code: str, *default_args: Any)[source]

Bases: object

A single ANSI CSI (Control Sequence Introducer) escape sequence.

Wraps one CSI final byte/code (e.g. 'H' for Cursor Position) and renders it as ESC [ args code. Calling the instance with no arguments falls back to the default argument(s) supplied at construction.

Store the final byte/code and its default argument(s).

Parameters:
  • code – The CSI final byte(s) appended after the argument list, e.g. 'H' for Cursor Position.

  • *default_args – Arguments used when the instance is called without any, e.g. (1, 1) for CUP’s default row/column.

class progressbar.terminal.base.CSINoArg(code: str, *default_args: Any)[source]

Bases: CSI

A CSI whose escape sequence never takes parameters.

Narrows __call__ to accept no arguments, since sequences such as HIDE_CURSOR (?25l) are parameterless. The base CSI.__call__ signature would otherwise let callers pass values that are silently ignored (falling back to the default arguments).

Store the final byte/code and its default argument(s).

Parameters:
  • code – The CSI final byte(s) appended after the argument list, e.g. 'H' for Cursor Position.

  • *default_args – Arguments used when the instance is called without any, e.g. (1, 1) for CUP’s default row/column.

progressbar.terminal.base.CUP: CSI = <progressbar.terminal.base.CSI object>

Cursor Position [row;column] (default = [1,1])

class progressbar.terminal.base.Color(rgb: RGB, hls: HSL, name: str | None, xterm: int | None)[source]

Bases: NamedTuple

Color base class.

Contains the color in RGB (Red, Green, Blue), HSL (Hue, Saturation, Lightness) and Xterm (8-bit) representations, plus an optional name.

To make a custom color the only required argument is rgb. The other values are automatically derived from it if omitted, but you can be more explicit if you wish.

Create new instance of Color(rgb, hls, name, xterm)

property ansi: str | None

ANSI SGR color parameter for this color, or None.

Picks the encoding by resolving, in order: truecolor (if env.COLOR_SUPPORT is XTERM_TRUECOLOR), 16-color (if env.COLOR_SUPPORT is XTERM, via RGB.to_ansi_16), this color’s own registered xterm index, if it has one (checked with is not None, so a registered index of 0 counts – rendering an SGR at all means the caller already decided colors are wanted, even if global detection reports no support), then 256-color (RGB.to_ansi_256) if env.COLOR_SUPPORT is XTERM_256. Reads env.COLOR_SUPPORT live, at call time, like fg.

Returns:

The SGR color parameter (e.g. '5;196'), or None if no color encoding applies.

property bg: DummyColor | SGRColor

Background-color callable for this color.

Reads env.COLOR_SUPPORT live, at call time, like fg.

Returns:

A no-op DummyColor on the legacy Windows console (no background-color support there), otherwise an SGRColor (start code 48, end code 49).

property fg: SGRColor | WindowsColor

Foreground-color callable for this color.

Reads env.COLOR_SUPPORT live, at call time (not when this Color was constructed): a Color built long before rendering still styles according to whatever color support is detected when fg is actually accessed.

Returns:

A WindowsColor on the legacy Windows console, otherwise an SGRColor (start code 38, end code 39).

hls: HSL

The HSL representation. Note the field is named hls but holds an HSL value (hue, saturation, lightness) – see HSL.from_rgb.

interpolate(end: Color, step: float) Color[source]

Linearly interpolate between this color and end.

Parameters:
  • end – The color to interpolate toward.

  • step – Interpolation position for rgb/hls, 0 returns this color’s, 1 returns end’s. name/xterm aren’t numeric, so instead of interpolating they snap to whichever endpoint step is closer to (below 0.5 keeps this color’s, otherwise end’s).

Returns:

The interpolated color.

name: str | None

An optional human-readable name, e.g. 'red'.

rgb: RGB

The RGB representation.

property underline: DummyColor | SGRColor

Underline-color callable for this color.

Reads env.COLOR_SUPPORT live, at call time, like fg.

Returns:

A no-op DummyColor on the legacy Windows console, otherwise an SGRColor (start code 58, end code 59: the underline color, distinct from text color).

xterm: int | None

An optional registered xterm 256-color palette index, used by Colors.register/ansi.

class progressbar.terminal.base.ColorBase[source]

Bases: ABC

Deprecated common base for color-like classes, unused.

typing.NamedTuple doesn’t support multiple inheritance, so this class can’t actually be mixed into Color, and nothing subclasses it.

get_color(value: float) Color[source]

Unimplemented, deprecated and unused (see class docstring).

Raises:

NotImplementedError – Always.

class progressbar.terminal.base.ColorGradient(*colors: ~progressbar.terminal.base.Color, interpolate: ~collections.abc.Callable[[~progressbar.terminal.base.Color, ~progressbar.terminal.base.Color, float], ~progressbar.terminal.base.Color] | None = <bound method Colors.interpolate of <class 'progressbar.terminal.base.Colors'>>)[source]

Bases: object

A sequence of colors interpolated across a 0-1 value range.

Used for widgets whose color should shift with progress (e.g. a bar that goes from red to yellow to green as it nears completion). See get_color for how a value maps to a Color.

Store the gradient’s colors and interpolation function.

Parameters:
  • *colors – The colors to interpolate across, in order; at least one is required.

  • interpolate – The function used to blend between two adjacent colors given a 0-1 step. Pass None to disable blending and snap to the nearest color instead (see get_color).

colors: tuple[Color, ...]
get_color(value: float) Color[source]

Map value (0-1) to a Color from this gradient.

value is clamped to the gradient’s ends: <= 0 (or pbase.Undefined/pbase.UnknownLength) returns the first color, >= 1 returns the last. Otherwise, if interpolate is None, the nearest color by index is returned with no blending. If it’s set, value is split into a segment index (the pair of adjacent colors to blend between) and a 0-1 step within that segment, then blended via self.interpolate.

Note

The segment index and the within-segment step are each computed from a separate remap of value: the index uses a span of max_color_idx - 1 (so, for four or more colors, the first and last segments end up half the width of the interior ones), while the step assumes every segment is an equal 1 / max_color_idx wide. For gradients of four or more colors this mismatch means step can fall outside [0, 1] near an interior segment boundary, and Color.interpolate does not clamp it, so colors near those boundaries can extrapolate past the two blended stops rather than blend smoothly between them. Left as-is here (fixing it changes rendered gradient output) and documented as a known quirk rather than silently worked around.

Parameters:

value – Position in the gradient, 0-1.

Returns:

The color at value.

interpolate: Callable[[Color, Color, float], Color] | None
class progressbar.terminal.base.Colors[source]

Bases: object

Registry of Color instances, indexed for lookup.

register files a new Color into the dicts below, keyed by each representation, so a color can be looked up by any of them.

by_hex: ClassVar[defaultdict[str, list[Color]]] = {'#000000': [((0, 0, 0), (0, 0, 0), 'Black', 0), ((0, 0, 0), (0, 0, 0), 'Grey0', 16)], '#00005f': [((0, 0, 95), (240, 100, 19), 'NavyBlue', 17)], '#000080': [((0, 0, 128), (240, 100, 25), 'Navy', 4)], '#000087': [((0, 0, 135), (240, 100, 26), 'DarkBlue', 18)], '#0000af': [((0, 0, 175), (240, 100, 34), 'Blue3', 19)], '#0000d7': [((0, 0, 215), (240, 100, 42), 'Blue3', 20)], '#0000ff': [((0, 0, 255), (240, 100, 50), 'Blue', 12), ((0, 0, 255), (240, 100, 50), 'Blue1', 21)], '#005f00': [((0, 95, 0), (120, 100, 19), 'DarkGreen', 22)], '#005f5f': [((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23)], '#005f87': [((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24)], '#005faf': [((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25)], '#005fd7': [((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26)], '#005fff': [((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27)], '#008000': [((0, 128, 0), (120, 100, 25), 'Green', 2)], '#008080': [((0, 128, 128), (180, 100, 25), 'Teal', 6)], '#008700': [((0, 135, 0), (120, 100, 26), 'Green4', 28)], '#00875f': [((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29)], '#008787': [((0, 135, 135), (180, 100, 26), 'Turquoise4', 30)], '#0087af': [((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31)], '#0087d7': [((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32)], '#0087ff': [((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33)], '#00af00': [((0, 175, 0), (120, 100, 34), 'Green3', 34)], '#00af5f': [((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35)], '#00af87': [((0, 175, 135), (166, 100, 34), 'DarkCyan', 36)], '#00afaf': [((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37)], '#00afd7': [((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38)], '#00afff': [((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39)], '#00d700': [((0, 215, 0), (120, 100, 42), 'Green3', 40)], '#00d75f': [((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41)], '#00d787': [((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42)], '#00d7af': [((0, 215, 175), (169, 100, 42), 'Cyan3', 43)], '#00d7d7': [((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44)], '#00d7ff': [((0, 215, 255), (189, 100, 50), 'Turquoise2', 45)], '#00ff00': [((0, 255, 0), (120, 100, 50), 'Lime', 10), ((0, 255, 0), (120, 100, 50), 'Green1', 46)], '#00ff5f': [((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47)], '#00ff87': [((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48)], '#00ffaf': [((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49)], '#00ffd7': [((0, 255, 215), (171, 100, 50), 'Cyan2', 50)], '#00ffff': [((0, 255, 255), (180, 100, 50), 'Aqua', 14), ((0, 255, 255), (180, 100, 50), 'Cyan1', 51)], '#080808': [((8, 8, 8), (0, 0, 3), 'Grey3', 232)], '#121212': [((18, 18, 18), (0, 0, 7), 'Grey7', 233)], '#1c1c1c': [((28, 28, 28), (0, 0, 11), 'Grey11', 234)], '#262626': [((38, 38, 38), (0, 0, 15), 'Grey15', 235)], '#303030': [((48, 48, 48), (0, 0, 19), 'Grey19', 236)], '#3a3a3a': [((58, 58, 58), (0, 0, 23), 'Grey23', 237)], '#444444': [((68, 68, 68), (0, 0, 27), 'Grey27', 238)], '#4e4e4e': [((78, 78, 78), (0, 0, 31), 'Grey30', 239)], '#585858': [((88, 88, 88), (0, 0, 35), 'Grey35', 240)], '#5f0000': [((95, 0, 0), (0, 100, 19), 'DarkRed', 52)], '#5f005f': [((95, 0, 95), (300, 100, 19), 'DeepPink4', 53)], '#5f0087': [((95, 0, 135), (282, 100, 26), 'Purple4', 54)], '#5f00af': [((95, 0, 175), (273, 100, 34), 'Purple4', 55)], '#5f00d7': [((95, 0, 215), (267, 100, 42), 'Purple3', 56)], '#5f00ff': [((95, 0, 255), (262, 100, 50), 'BlueViolet', 57)], '#5f5f00': [((95, 95, 0), (60, 100, 19), 'Orange4', 58)], '#5f5f5f': [((95, 95, 95), (0, 0, 37), 'Grey37', 59)], '#5f5f87': [((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60)], '#5f5faf': [((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61)], '#5f5fd7': [((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62)], '#5f5fff': [((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63)], '#5f8700': [((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64)], '#5f875f': [((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65)], '#5f8787': [((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66)], '#5f87af': [((95, 135, 175), (210, 33, 53), 'SteelBlue', 67)], '#5f87d7': [((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68)], '#5f87ff': [((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69)], '#5faf00': [((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70)], '#5faf5f': [((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71)], '#5faf87': [((95, 175, 135), (150, 33, 53), 'CadetBlue', 72)], '#5fafaf': [((95, 175, 175), (180, 33, 53), 'CadetBlue', 73)], '#5fafd7': [((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74)], '#5fafff': [((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75)], '#5fd700': [((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76)], '#5fd75f': [((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77)], '#5fd787': [((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78)], '#5fd7af': [((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79)], '#5fd7d7': [((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80)], '#5fd7ff': [((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81)], '#5fff00': [((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82)], '#5fff5f': [((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83)], '#5fff87': [((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84)], '#5fffaf': [((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85)], '#5fffd7': [((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86)], '#5fffff': [((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87)], '#626262': [((98, 98, 98), (0, 0, 38), 'Grey39', 241)], '#6c6c6c': [((108, 108, 108), (0, 0, 42), 'Grey42', 242)], '#767676': [((118, 118, 118), (0, 0, 46), 'Grey46', 243)], '#800000': [((128, 0, 0), (0, 100, 25), 'Maroon', 1)], '#800080': [((128, 0, 128), (300, 100, 25), 'Purple', 5)], '#808000': [((128, 128, 0), (60, 100, 25), 'Olive', 3)], '#808080': [((128, 128, 128), (0, 0, 50), 'Grey', 8), ((128, 128, 128), (0, 0, 50), 'Grey50', 244)], '#870000': [((135, 0, 0), (0, 100, 26), 'DarkRed', 88)], '#87005f': [((135, 0, 95), (318, 100, 26), 'DeepPink4', 89)], '#870087': [((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90)], '#8700af': [((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91)], '#8700d7': [((135, 0, 215), (278, 100, 42), 'DarkViolet', 92)], '#8700ff': [((135, 0, 255), (272, 100, 50), 'Purple', 93)], '#875f00': [((135, 95, 0), (42, 100, 26), 'Orange4', 94)], '#875f5f': [((135, 95, 95), (0, 17, 45), 'LightPink4', 95)], '#875f87': [((135, 95, 135), (300, 17, 45), 'Plum4', 96)], '#875faf': [((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97)], '#875fd7': [((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98)], '#875fff': [((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99)], '#878700': [((135, 135, 0), (60, 100, 26), 'Yellow4', 100)], '#87875f': [((135, 135, 95), (60, 17, 45), 'Wheat4', 101)], '#878787': [((135, 135, 135), (0, 0, 53), 'Grey53', 102)], '#8787af': [((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103)], '#8787d7': [((135, 135, 215), (240, 50, 69), 'MediumPurple', 104)], '#8787ff': [((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105)], '#87af00': [((135, 175, 0), (74, 100, 34), 'Yellow4', 106)], '#87af5f': [((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107)], '#87af87': [((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108)], '#87afaf': [((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109)], '#87afd7': [((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110)], '#87afff': [((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111)], '#87d700': [((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112)], '#87d75f': [((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113)], '#87d787': [((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114)], '#87d7af': [((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115)], '#87d7d7': [((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116)], '#87d7ff': [((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117)], '#87ff00': [((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118)], '#87ff5f': [((135, 255, 95), (105, 100, 69), 'LightGreen', 119)], '#87ff87': [((135, 255, 135), (120, 100, 76), 'LightGreen', 120)], '#87ffaf': [((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121)], '#87ffd7': [((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122)], '#87ffff': [((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123)], '#8a8a8a': [((138, 138, 138), (0, 0, 54), 'Grey54', 245)], '#949494': [((148, 148, 148), (0, 0, 58), 'Grey58', 246)], '#9e9e9e': [((158, 158, 158), (0, 0, 62), 'Grey62', 247)], '#a8a8a8': [((168, 168, 168), (0, 0, 66), 'Grey66', 248)], '#af0000': [((175, 0, 0), (0, 100, 34), 'Red3', 124)], '#af005f': [((175, 0, 95), (327, 100, 34), 'DeepPink4', 125)], '#af0087': [((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126)], '#af00af': [((175, 0, 175), (300, 100, 34), 'Magenta3', 127)], '#af00d7': [((175, 0, 215), (289, 100, 42), 'DarkViolet', 128)], '#af00ff': [((175, 0, 255), (281, 100, 50), 'Purple', 129)], '#af5f00': [((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130)], '#af5f5f': [((175, 95, 95), (0, 33, 53), 'IndianRed', 131)], '#af5f87': [((175, 95, 135), (330, 33, 53), 'HotPink3', 132)], '#af5faf': [((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133)], '#af5fd7': [((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134)], '#af5fff': [((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135)], '#af8700': [((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136)], '#af875f': [((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137)], '#af8787': [((175, 135, 135), (0, 20, 61), 'RosyBrown', 138)], '#af87af': [((175, 135, 175), (300, 20, 61), 'Grey63', 139)], '#af87d7': [((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140)], '#af87ff': [((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141)], '#afaf00': [((175, 175, 0), (60, 100, 34), 'Gold3', 142)], '#afaf5f': [((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143)], '#afaf87': [((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144)], '#afafaf': [((175, 175, 175), (0, 0, 69), 'Grey69', 145)], '#afafd7': [((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146)], '#afafff': [((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147)], '#afd700': [((175, 215, 0), (71, 100, 42), 'Yellow3', 148)], '#afd75f': [((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149)], '#afd787': [((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150)], '#afd7af': [((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151)], '#afd7d7': [((175, 215, 215), (180, 33, 76), 'LightCyan3', 152)], '#afd7ff': [((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153)], '#afff00': [((175, 255, 0), (79, 100, 50), 'GreenYellow', 154)], '#afff5f': [((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155)], '#afff87': [((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156)], '#afffaf': [((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157)], '#afffd7': [((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158)], '#afffff': [((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159)], '#b2b2b2': [((178, 178, 178), (0, 0, 70), 'Grey70', 249)], '#bcbcbc': [((188, 188, 188), (0, 0, 74), 'Grey74', 250)], '#c0c0c0': [((192, 192, 192), (0, 0, 75), 'Silver', 7)], '#c6c6c6': [((198, 198, 198), (0, 0, 78), 'Grey78', 251)], '#d0d0d0': [((208, 208, 208), (0, 0, 82), 'Grey82', 252)], '#d70000': [((215, 0, 0), (0, 100, 42), 'Red3', 160)], '#d7005f': [((215, 0, 95), (333, 100, 42), 'DeepPink3', 161)], '#d70087': [((215, 0, 135), (322, 100, 42), 'DeepPink3', 162)], '#d700af': [((215, 0, 175), (311, 100, 42), 'Magenta3', 163)], '#d700d7': [((215, 0, 215), (300, 100, 42), 'Magenta3', 164)], '#d700ff': [((215, 0, 255), (291, 100, 50), 'Magenta2', 165)], '#d75f00': [((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166)], '#d75f5f': [((215, 95, 95), (0, 60, 61), 'IndianRed', 167)], '#d75f87': [((215, 95, 135), (340, 60, 61), 'HotPink3', 168)], '#d75faf': [((215, 95, 175), (320, 60, 61), 'HotPink2', 169)], '#d75fd7': [((215, 95, 215), (300, 60, 61), 'Orchid', 170)], '#d75fff': [((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171)], '#d78700': [((215, 135, 0), (38, 100, 42), 'Orange3', 172)], '#d7875f': [((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173)], '#d78787': [((215, 135, 135), (0, 50, 69), 'LightPink3', 174)], '#d787af': [((215, 135, 175), (330, 50, 69), 'Pink3', 175)], '#d787d7': [((215, 135, 215), (300, 50, 69), 'Plum3', 176)], '#d787ff': [((215, 135, 255), (280, 100, 76), 'Violet', 177)], '#d7af00': [((215, 175, 0), (49, 100, 42), 'Gold3', 178)], '#d7af5f': [((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179)], '#d7af87': [((215, 175, 135), (30, 50, 69), 'Tan', 180)], '#d7afaf': [((215, 175, 175), (0, 33, 76), 'MistyRose3', 181)], '#d7afd7': [((215, 175, 215), (300, 33, 76), 'Thistle3', 182)], '#d7afff': [((215, 175, 255), (270, 100, 84), 'Plum2', 183)], '#d7d700': [((215, 215, 0), (60, 100, 42), 'Yellow3', 184)], '#d7d75f': [((215, 215, 95), (60, 60, 61), 'Khaki3', 185)], '#d7d787': [((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186)], '#d7d7af': [((215, 215, 175), (60, 33, 76), 'LightYellow3', 187)], '#d7d7d7': [((215, 215, 215), (0, 0, 84), 'Grey84', 188)], '#d7d7ff': [((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189)], '#d7ff00': [((215, 255, 0), (69, 100, 50), 'Yellow2', 190)], '#d7ff5f': [((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191)], '#d7ff87': [((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192)], '#d7ffaf': [((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193)], '#d7ffd7': [((215, 255, 215), (120, 100, 92), 'Honeydew2', 194)], '#d7ffff': [((215, 255, 255), (180, 100, 92), 'LightCyan1', 195)], '#dadada': [((218, 218, 218), (0, 0, 85), 'Grey85', 253)], '#e4e4e4': [((228, 228, 228), (0, 0, 89), 'Grey89', 254)], '#eeeeee': [((238, 238, 238), (0, 0, 93), 'Grey93', 255)], '#ff0000': [((255, 0, 0), (0, 100, 50), 'Red', 9), ((255, 0, 0), (0, 100, 50), 'Red1', 196)], '#ff005f': [((255, 0, 95), (338, 100, 50), 'DeepPink2', 197)], '#ff0087': [((255, 0, 135), (328, 100, 50), 'DeepPink1', 198)], '#ff00af': [((255, 0, 175), (319, 100, 50), 'DeepPink1', 199)], '#ff00d7': [((255, 0, 215), (309, 100, 50), 'Magenta2', 200)], '#ff00ff': [((255, 0, 255), (300, 100, 50), 'Fuchsia', 13), ((255, 0, 255), (300, 100, 50), 'Magenta1', 201)], '#ff5f00': [((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202)], '#ff5f5f': [((255, 95, 95), (0, 100, 69), 'IndianRed1', 203)], '#ff5f87': [((255, 95, 135), (345, 100, 69), 'IndianRed1', 204)], '#ff5faf': [((255, 95, 175), (330, 100, 69), 'HotPink', 205)], '#ff5fd7': [((255, 95, 215), (315, 100, 69), 'HotPink', 206)], '#ff5fff': [((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207)], '#ff8700': [((255, 135, 0), (32, 100, 50), 'DarkOrange', 208)], '#ff875f': [((255, 135, 95), (15, 100, 69), 'Salmon1', 209)], '#ff8787': [((255, 135, 135), (0, 100, 76), 'LightCoral', 210)], '#ff87af': [((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211)], '#ff87d7': [((255, 135, 215), (320, 100, 76), 'Orchid2', 212)], '#ff87ff': [((255, 135, 255), (300, 100, 76), 'Orchid1', 213)], '#ffaf00': [((255, 175, 0), (41, 100, 50), 'Orange1', 214)], '#ffaf5f': [((255, 175, 95), (30, 100, 69), 'SandyBrown', 215)], '#ffaf87': [((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216)], '#ffafaf': [((255, 175, 175), (0, 100, 84), 'LightPink1', 217)], '#ffafd7': [((255, 175, 215), (330, 100, 84), 'Pink1', 218)], '#ffafff': [((255, 175, 255), (300, 100, 84), 'Plum1', 219)], '#ffd700': [((255, 215, 0), (51, 100, 50), 'Gold1', 220)], '#ffd75f': [((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221)], '#ffd787': [((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222)], '#ffd7af': [((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223)], '#ffd7d7': [((255, 215, 215), (0, 100, 92), 'MistyRose1', 224)], '#ffd7ff': [((255, 215, 255), (300, 100, 92), 'Thistle1', 225)], '#ffff00': [((255, 255, 0), (60, 100, 50), 'Yellow', 11), ((255, 255, 0), (60, 100, 50), 'Yellow1', 226)], '#ffff5f': [((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227)], '#ffff87': [((255, 255, 135), (60, 100, 76), 'Khaki1', 228)], '#ffffaf': [((255, 255, 175), (60, 100, 84), 'Wheat1', 229)], '#ffffd7': [((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230)], '#ffffff': [((255, 255, 255), (0, 0, 100), 'White', 15), ((255, 255, 255), (0, 0, 100), 'Grey100', 231)]}

Registered colors keyed by RGB.hex.

by_hls: ClassVar[defaultdict[HSL, list[Color]]] = {(0, 0, 0): [((0, 0, 0), (0, 0, 0), 'Black', 0), ((0, 0, 0), (0, 0, 0), 'Grey0', 16)], (0, 0, 3): [((8, 8, 8), (0, 0, 3), 'Grey3', 232)], (0, 0, 7): [((18, 18, 18), (0, 0, 7), 'Grey7', 233)], (0, 0, 11): [((28, 28, 28), (0, 0, 11), 'Grey11', 234)], (0, 0, 15): [((38, 38, 38), (0, 0, 15), 'Grey15', 235)], (0, 0, 19): [((48, 48, 48), (0, 0, 19), 'Grey19', 236)], (0, 0, 23): [((58, 58, 58), (0, 0, 23), 'Grey23', 237)], (0, 0, 27): [((68, 68, 68), (0, 0, 27), 'Grey27', 238)], (0, 0, 31): [((78, 78, 78), (0, 0, 31), 'Grey30', 239)], (0, 0, 35): [((88, 88, 88), (0, 0, 35), 'Grey35', 240)], (0, 0, 37): [((95, 95, 95), (0, 0, 37), 'Grey37', 59)], (0, 0, 38): [((98, 98, 98), (0, 0, 38), 'Grey39', 241)], (0, 0, 42): [((108, 108, 108), (0, 0, 42), 'Grey42', 242)], (0, 0, 46): [((118, 118, 118), (0, 0, 46), 'Grey46', 243)], (0, 0, 50): [((128, 128, 128), (0, 0, 50), 'Grey', 8), ((128, 128, 128), (0, 0, 50), 'Grey50', 244)], (0, 0, 53): [((135, 135, 135), (0, 0, 53), 'Grey53', 102)], (0, 0, 54): [((138, 138, 138), (0, 0, 54), 'Grey54', 245)], (0, 0, 58): [((148, 148, 148), (0, 0, 58), 'Grey58', 246)], (0, 0, 62): [((158, 158, 158), (0, 0, 62), 'Grey62', 247)], (0, 0, 66): [((168, 168, 168), (0, 0, 66), 'Grey66', 248)], (0, 0, 69): [((175, 175, 175), (0, 0, 69), 'Grey69', 145)], (0, 0, 70): [((178, 178, 178), (0, 0, 70), 'Grey70', 249)], (0, 0, 74): [((188, 188, 188), (0, 0, 74), 'Grey74', 250)], (0, 0, 75): [((192, 192, 192), (0, 0, 75), 'Silver', 7)], (0, 0, 78): [((198, 198, 198), (0, 0, 78), 'Grey78', 251)], (0, 0, 82): [((208, 208, 208), (0, 0, 82), 'Grey82', 252)], (0, 0, 84): [((215, 215, 215), (0, 0, 84), 'Grey84', 188)], (0, 0, 85): [((218, 218, 218), (0, 0, 85), 'Grey85', 253)], (0, 0, 89): [((228, 228, 228), (0, 0, 89), 'Grey89', 254)], (0, 0, 93): [((238, 238, 238), (0, 0, 93), 'Grey93', 255)], (0, 0, 100): [((255, 255, 255), (0, 0, 100), 'White', 15), ((255, 255, 255), (0, 0, 100), 'Grey100', 231)], (0, 17, 45): [((135, 95, 95), (0, 17, 45), 'LightPink4', 95)], (0, 20, 61): [((175, 135, 135), (0, 20, 61), 'RosyBrown', 138)], (0, 33, 53): [((175, 95, 95), (0, 33, 53), 'IndianRed', 131)], (0, 33, 76): [((215, 175, 175), (0, 33, 76), 'MistyRose3', 181)], (0, 50, 69): [((215, 135, 135), (0, 50, 69), 'LightPink3', 174)], (0, 60, 61): [((215, 95, 95), (0, 60, 61), 'IndianRed', 167)], (0, 100, 19): [((95, 0, 0), (0, 100, 19), 'DarkRed', 52)], (0, 100, 25): [((128, 0, 0), (0, 100, 25), 'Maroon', 1)], (0, 100, 26): [((135, 0, 0), (0, 100, 26), 'DarkRed', 88)], (0, 100, 34): [((175, 0, 0), (0, 100, 34), 'Red3', 124)], (0, 100, 42): [((215, 0, 0), (0, 100, 42), 'Red3', 160)], (0, 100, 50): [((255, 0, 0), (0, 100, 50), 'Red', 9), ((255, 0, 0), (0, 100, 50), 'Red1', 196)], (0, 100, 69): [((255, 95, 95), (0, 100, 69), 'IndianRed1', 203)], (0, 100, 76): [((255, 135, 135), (0, 100, 76), 'LightCoral', 210)], (0, 100, 84): [((255, 175, 175), (0, 100, 84), 'LightPink1', 217)], (0, 100, 92): [((255, 215, 215), (0, 100, 92), 'MistyRose1', 224)], (15, 100, 69): [((255, 135, 95), (15, 100, 69), 'Salmon1', 209)], (20, 60, 61): [((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173)], (20, 100, 76): [((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216)], (22, 100, 50): [((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202)], (27, 100, 42): [((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166)], (30, 33, 53): [((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137)], (30, 50, 69): [((215, 175, 135), (30, 50, 69), 'Tan', 180)], (30, 100, 69): [((255, 175, 95), (30, 100, 69), 'SandyBrown', 215)], (30, 100, 84): [((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223)], (32, 100, 50): [((255, 135, 0), (32, 100, 50), 'DarkOrange', 208)], (33, 100, 34): [((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130)], (38, 100, 42): [((215, 135, 0), (38, 100, 42), 'Orange3', 172)], (40, 60, 61): [((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179)], (40, 100, 76): [((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222)], (41, 100, 50): [((255, 175, 0), (41, 100, 50), 'Orange1', 214)], (42, 100, 26): [((135, 95, 0), (42, 100, 26), 'Orange4', 94)], (45, 100, 69): [((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221)], (46, 100, 34): [((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136)], (49, 100, 42): [((215, 175, 0), (49, 100, 42), 'Gold3', 178)], (51, 100, 50): [((255, 215, 0), (51, 100, 50), 'Gold1', 220)], (60, 17, 45): [((135, 135, 95), (60, 17, 45), 'Wheat4', 101)], (60, 20, 61): [((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144)], (60, 33, 53): [((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143)], (60, 33, 76): [((215, 215, 175), (60, 33, 76), 'LightYellow3', 187)], (60, 50, 69): [((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186)], (60, 60, 61): [((215, 215, 95), (60, 60, 61), 'Khaki3', 185)], (60, 100, 19): [((95, 95, 0), (60, 100, 19), 'Orange4', 58)], (60, 100, 25): [((128, 128, 0), (60, 100, 25), 'Olive', 3)], (60, 100, 26): [((135, 135, 0), (60, 100, 26), 'Yellow4', 100)], (60, 100, 34): [((175, 175, 0), (60, 100, 34), 'Gold3', 142)], (60, 100, 42): [((215, 215, 0), (60, 100, 42), 'Yellow3', 184)], (60, 100, 50): [((255, 255, 0), (60, 100, 50), 'Yellow', 11), ((255, 255, 0), (60, 100, 50), 'Yellow1', 226)], (60, 100, 69): [((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227)], (60, 100, 76): [((255, 255, 135), (60, 100, 76), 'Khaki1', 228)], (60, 100, 84): [((255, 255, 175), (60, 100, 84), 'Wheat1', 229)], (60, 100, 92): [((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230)], (69, 100, 50): [((215, 255, 0), (69, 100, 50), 'Yellow2', 190)], (71, 100, 42): [((175, 215, 0), (71, 100, 42), 'Yellow3', 148)], (74, 100, 34): [((135, 175, 0), (74, 100, 34), 'Yellow4', 106)], (75, 100, 69): [((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191)], (78, 100, 26): [((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64)], (79, 100, 50): [((175, 255, 0), (79, 100, 50), 'GreenYellow', 154)], (80, 60, 61): [((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149)], (80, 100, 76): [((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192)], (82, 100, 42): [((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112)], (87, 100, 34): [((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70)], (88, 100, 50): [((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118)], (90, 33, 53): [((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107)], (90, 50, 69): [((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150)], (90, 100, 69): [((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155)], (90, 100, 84): [((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193)], (93, 100, 42): [((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76)], (98, 100, 50): [((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82)], (100, 60, 61): [((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113)], (100, 100, 76): [((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156)], (105, 100, 69): [((135, 255, 95), (105, 100, 69), 'LightGreen', 119)], (120, 17, 45): [((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65)], (120, 20, 61): [((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108)], (120, 33, 53): [((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71)], (120, 33, 76): [((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151)], (120, 50, 69): [((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114)], (120, 60, 61): [((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77)], (120, 100, 19): [((0, 95, 0), (120, 100, 19), 'DarkGreen', 22)], (120, 100, 25): [((0, 128, 0), (120, 100, 25), 'Green', 2)], (120, 100, 26): [((0, 135, 0), (120, 100, 26), 'Green4', 28)], (120, 100, 34): [((0, 175, 0), (120, 100, 34), 'Green3', 34)], (120, 100, 42): [((0, 215, 0), (120, 100, 42), 'Green3', 40)], (120, 100, 50): [((0, 255, 0), (120, 100, 50), 'Lime', 10), ((0, 255, 0), (120, 100, 50), 'Green1', 46)], (120, 100, 69): [((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83)], (120, 100, 76): [((135, 255, 135), (120, 100, 76), 'LightGreen', 120)], (120, 100, 84): [((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157)], (120, 100, 92): [((215, 255, 215), (120, 100, 92), 'Honeydew2', 194)], (135, 100, 69): [((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84)], (140, 60, 61): [((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78)], (140, 100, 76): [((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121)], (142, 100, 50): [((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47)], (147, 100, 42): [((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41)], (150, 33, 53): [((95, 175, 135), (150, 33, 53), 'CadetBlue', 72)], (150, 50, 69): [((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115)], (150, 100, 69): [((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85)], (150, 100, 84): [((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158)], (152, 100, 50): [((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48)], (153, 100, 34): [((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35)], (158, 100, 42): [((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42)], (160, 60, 61): [((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79)], (160, 100, 76): [((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122)], (161, 100, 50): [((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49)], (162, 100, 26): [((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29)], (165, 100, 69): [((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86)], (166, 100, 34): [((0, 175, 135), (166, 100, 34), 'DarkCyan', 36)], (169, 100, 42): [((0, 215, 175), (169, 100, 42), 'Cyan3', 43)], (171, 100, 50): [((0, 255, 215), (171, 100, 50), 'Cyan2', 50)], (180, 17, 45): [((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66)], (180, 20, 61): [((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109)], (180, 33, 53): [((95, 175, 175), (180, 33, 53), 'CadetBlue', 73)], (180, 33, 76): [((175, 215, 215), (180, 33, 76), 'LightCyan3', 152)], (180, 50, 69): [((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116)], (180, 60, 61): [((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80)], (180, 100, 19): [((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23)], (180, 100, 25): [((0, 128, 128), (180, 100, 25), 'Teal', 6)], (180, 100, 26): [((0, 135, 135), (180, 100, 26), 'Turquoise4', 30)], (180, 100, 34): [((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37)], (180, 100, 42): [((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44)], (180, 100, 50): [((0, 255, 255), (180, 100, 50), 'Aqua', 14), ((0, 255, 255), (180, 100, 50), 'Cyan1', 51)], (180, 100, 69): [((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87)], (180, 100, 76): [((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123)], (180, 100, 84): [((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159)], (180, 100, 92): [((215, 255, 255), (180, 100, 92), 'LightCyan1', 195)], (189, 100, 50): [((0, 215, 255), (189, 100, 50), 'Turquoise2', 45)], (191, 100, 42): [((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38)], (194, 100, 34): [((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31)], (195, 100, 69): [((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81)], (198, 100, 26): [((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24)], (199, 100, 50): [((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39)], (200, 60, 61): [((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74)], (200, 100, 76): [((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117)], (202, 100, 42): [((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32)], (207, 100, 34): [((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25)], (208, 100, 50): [((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33)], (210, 33, 53): [((95, 135, 175), (210, 33, 53), 'SteelBlue', 67)], (210, 50, 69): [((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110)], (210, 100, 69): [((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75)], (210, 100, 84): [((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153)], (213, 100, 42): [((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26)], (218, 100, 50): [((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27)], (220, 60, 61): [((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68)], (220, 100, 76): [((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111)], (225, 100, 69): [((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69)], (240, 17, 45): [((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60)], (240, 20, 61): [((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103)], (240, 33, 53): [((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61)], (240, 33, 76): [((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146)], (240, 50, 69): [((135, 135, 215), (240, 50, 69), 'MediumPurple', 104)], (240, 60, 61): [((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62)], (240, 100, 19): [((0, 0, 95), (240, 100, 19), 'NavyBlue', 17)], (240, 100, 25): [((0, 0, 128), (240, 100, 25), 'Navy', 4)], (240, 100, 26): [((0, 0, 135), (240, 100, 26), 'DarkBlue', 18)], (240, 100, 34): [((0, 0, 175), (240, 100, 34), 'Blue3', 19)], (240, 100, 42): [((0, 0, 215), (240, 100, 42), 'Blue3', 20)], (240, 100, 50): [((0, 0, 255), (240, 100, 50), 'Blue', 12), ((0, 0, 255), (240, 100, 50), 'Blue1', 21)], (240, 100, 69): [((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63)], (240, 100, 76): [((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105)], (240, 100, 84): [((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147)], (240, 100, 92): [((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189)], (255, 100, 69): [((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99)], (260, 60, 61): [((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98)], (260, 100, 76): [((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141)], (262, 100, 50): [((95, 0, 255), (262, 100, 50), 'BlueViolet', 57)], (267, 100, 42): [((95, 0, 215), (267, 100, 42), 'Purple3', 56)], (270, 33, 53): [((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97)], (270, 50, 69): [((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140)], (270, 100, 69): [((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135)], (270, 100, 84): [((215, 175, 255), (270, 100, 84), 'Plum2', 183)], (272, 100, 50): [((135, 0, 255), (272, 100, 50), 'Purple', 93)], (273, 100, 34): [((95, 0, 175), (273, 100, 34), 'Purple4', 55)], (278, 100, 42): [((135, 0, 215), (278, 100, 42), 'DarkViolet', 92)], (280, 60, 61): [((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134)], (280, 100, 76): [((215, 135, 255), (280, 100, 76), 'Violet', 177)], (281, 100, 50): [((175, 0, 255), (281, 100, 50), 'Purple', 129)], (282, 100, 26): [((95, 0, 135), (282, 100, 26), 'Purple4', 54)], (285, 100, 69): [((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171)], (286, 100, 34): [((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91)], (289, 100, 42): [((175, 0, 215), (289, 100, 42), 'DarkViolet', 128)], (291, 100, 50): [((215, 0, 255), (291, 100, 50), 'Magenta2', 165)], (300, 17, 45): [((135, 95, 135), (300, 17, 45), 'Plum4', 96)], (300, 20, 61): [((175, 135, 175), (300, 20, 61), 'Grey63', 139)], (300, 33, 53): [((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133)], (300, 33, 76): [((215, 175, 215), (300, 33, 76), 'Thistle3', 182)], (300, 50, 69): [((215, 135, 215), (300, 50, 69), 'Plum3', 176)], (300, 60, 61): [((215, 95, 215), (300, 60, 61), 'Orchid', 170)], (300, 100, 19): [((95, 0, 95), (300, 100, 19), 'DeepPink4', 53)], (300, 100, 25): [((128, 0, 128), (300, 100, 25), 'Purple', 5)], (300, 100, 26): [((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90)], (300, 100, 34): [((175, 0, 175), (300, 100, 34), 'Magenta3', 127)], (300, 100, 42): [((215, 0, 215), (300, 100, 42), 'Magenta3', 164)], (300, 100, 50): [((255, 0, 255), (300, 100, 50), 'Fuchsia', 13), ((255, 0, 255), (300, 100, 50), 'Magenta1', 201)], (300, 100, 69): [((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207)], (300, 100, 76): [((255, 135, 255), (300, 100, 76), 'Orchid1', 213)], (300, 100, 84): [((255, 175, 255), (300, 100, 84), 'Plum1', 219)], (300, 100, 92): [((255, 215, 255), (300, 100, 92), 'Thistle1', 225)], (309, 100, 50): [((255, 0, 215), (309, 100, 50), 'Magenta2', 200)], (311, 100, 42): [((215, 0, 175), (311, 100, 42), 'Magenta3', 163)], (314, 100, 34): [((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126)], (315, 100, 69): [((255, 95, 215), (315, 100, 69), 'HotPink', 206)], (318, 100, 26): [((135, 0, 95), (318, 100, 26), 'DeepPink4', 89)], (319, 100, 50): [((255, 0, 175), (319, 100, 50), 'DeepPink1', 199)], (320, 60, 61): [((215, 95, 175), (320, 60, 61), 'HotPink2', 169)], (320, 100, 76): [((255, 135, 215), (320, 100, 76), 'Orchid2', 212)], (322, 100, 42): [((215, 0, 135), (322, 100, 42), 'DeepPink3', 162)], (327, 100, 34): [((175, 0, 95), (327, 100, 34), 'DeepPink4', 125)], (328, 100, 50): [((255, 0, 135), (328, 100, 50), 'DeepPink1', 198)], (330, 33, 53): [((175, 95, 135), (330, 33, 53), 'HotPink3', 132)], (330, 50, 69): [((215, 135, 175), (330, 50, 69), 'Pink3', 175)], (330, 100, 69): [((255, 95, 175), (330, 100, 69), 'HotPink', 205)], (330, 100, 84): [((255, 175, 215), (330, 100, 84), 'Pink1', 218)], (333, 100, 42): [((215, 0, 95), (333, 100, 42), 'DeepPink3', 161)], (338, 100, 50): [((255, 0, 95), (338, 100, 50), 'DeepPink2', 197)], (340, 60, 61): [((215, 95, 135), (340, 60, 61), 'HotPink3', 168)], (340, 100, 76): [((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211)], (345, 100, 69): [((255, 95, 135), (345, 100, 69), 'IndianRed1', 204)]}

Registered colors keyed by HSL.

by_lowername: ClassVar[defaultdict[str, list[Color]]] = {'aqua': [((0, 255, 255), (180, 100, 50), 'Aqua', 14)], 'aquamarine1': [((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86), ((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122)], 'aquamarine3': [((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79)], 'black': [((0, 0, 0), (0, 0, 0), 'Black', 0)], 'blue': [((0, 0, 255), (240, 100, 50), 'Blue', 12)], 'blue1': [((0, 0, 255), (240, 100, 50), 'Blue1', 21)], 'blue3': [((0, 0, 175), (240, 100, 34), 'Blue3', 19), ((0, 0, 215), (240, 100, 42), 'Blue3', 20)], 'blueviolet': [((95, 0, 255), (262, 100, 50), 'BlueViolet', 57)], 'cadetblue': [((95, 175, 135), (150, 33, 53), 'CadetBlue', 72), ((95, 175, 175), (180, 33, 53), 'CadetBlue', 73)], 'chartreuse1': [((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118)], 'chartreuse2': [((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82), ((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112)], 'chartreuse3': [((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70), ((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76)], 'chartreuse4': [((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64)], 'cornflowerblue': [((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69)], 'cornsilk1': [((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230)], 'cyan1': [((0, 255, 255), (180, 100, 50), 'Cyan1', 51)], 'cyan2': [((0, 255, 215), (171, 100, 50), 'Cyan2', 50)], 'cyan3': [((0, 215, 175), (169, 100, 42), 'Cyan3', 43)], 'darkblue': [((0, 0, 135), (240, 100, 26), 'DarkBlue', 18)], 'darkcyan': [((0, 175, 135), (166, 100, 34), 'DarkCyan', 36)], 'darkgoldenrod': [((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136)], 'darkgreen': [((0, 95, 0), (120, 100, 19), 'DarkGreen', 22)], 'darkkhaki': [((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143)], 'darkmagenta': [((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90), ((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91)], 'darkolivegreen1': [((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191), ((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192)], 'darkolivegreen2': [((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155)], 'darkolivegreen3': [((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107), ((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113), ((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149)], 'darkorange': [((255, 135, 0), (32, 100, 50), 'DarkOrange', 208)], 'darkorange3': [((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130), ((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166)], 'darkred': [((95, 0, 0), (0, 100, 19), 'DarkRed', 52), ((135, 0, 0), (0, 100, 26), 'DarkRed', 88)], 'darkseagreen': [((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108)], 'darkseagreen1': [((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158), ((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193)], 'darkseagreen2': [((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151), ((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157)], 'darkseagreen3': [((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115), ((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150)], 'darkseagreen4': [((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65), ((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71)], 'darkslategray1': [((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123)], 'darkslategray2': [((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87)], 'darkslategray3': [((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116)], 'darkturquoise': [((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44)], 'darkviolet': [((135, 0, 215), (278, 100, 42), 'DarkViolet', 92), ((175, 0, 215), (289, 100, 42), 'DarkViolet', 128)], 'deeppink1': [((255, 0, 135), (328, 100, 50), 'DeepPink1', 198), ((255, 0, 175), (319, 100, 50), 'DeepPink1', 199)], 'deeppink2': [((255, 0, 95), (338, 100, 50), 'DeepPink2', 197)], 'deeppink3': [((215, 0, 95), (333, 100, 42), 'DeepPink3', 161), ((215, 0, 135), (322, 100, 42), 'DeepPink3', 162)], 'deeppink4': [((95, 0, 95), (300, 100, 19), 'DeepPink4', 53), ((135, 0, 95), (318, 100, 26), 'DeepPink4', 89), ((175, 0, 95), (327, 100, 34), 'DeepPink4', 125)], 'deepskyblue1': [((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39)], 'deepskyblue2': [((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38)], 'deepskyblue3': [((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31), ((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32)], 'deepskyblue4': [((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23), ((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24), ((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25)], 'dodgerblue1': [((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33)], 'dodgerblue2': [((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27)], 'dodgerblue3': [((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26)], 'fuchsia': [((255, 0, 255), (300, 100, 50), 'Fuchsia', 13)], 'gold1': [((255, 215, 0), (51, 100, 50), 'Gold1', 220)], 'gold3': [((175, 175, 0), (60, 100, 34), 'Gold3', 142), ((215, 175, 0), (49, 100, 42), 'Gold3', 178)], 'green': [((0, 128, 0), (120, 100, 25), 'Green', 2)], 'green1': [((0, 255, 0), (120, 100, 50), 'Green1', 46)], 'green3': [((0, 175, 0), (120, 100, 34), 'Green3', 34), ((0, 215, 0), (120, 100, 42), 'Green3', 40)], 'green4': [((0, 135, 0), (120, 100, 26), 'Green4', 28)], 'greenyellow': [((175, 255, 0), (79, 100, 50), 'GreenYellow', 154)], 'grey': [((128, 128, 128), (0, 0, 50), 'Grey', 8)], 'grey0': [((0, 0, 0), (0, 0, 0), 'Grey0', 16)], 'grey100': [((255, 255, 255), (0, 0, 100), 'Grey100', 231)], 'grey11': [((28, 28, 28), (0, 0, 11), 'Grey11', 234)], 'grey15': [((38, 38, 38), (0, 0, 15), 'Grey15', 235)], 'grey19': [((48, 48, 48), (0, 0, 19), 'Grey19', 236)], 'grey23': [((58, 58, 58), (0, 0, 23), 'Grey23', 237)], 'grey27': [((68, 68, 68), (0, 0, 27), 'Grey27', 238)], 'grey3': [((8, 8, 8), (0, 0, 3), 'Grey3', 232)], 'grey30': [((78, 78, 78), (0, 0, 31), 'Grey30', 239)], 'grey35': [((88, 88, 88), (0, 0, 35), 'Grey35', 240)], 'grey37': [((95, 95, 95), (0, 0, 37), 'Grey37', 59)], 'grey39': [((98, 98, 98), (0, 0, 38), 'Grey39', 241)], 'grey42': [((108, 108, 108), (0, 0, 42), 'Grey42', 242)], 'grey46': [((118, 118, 118), (0, 0, 46), 'Grey46', 243)], 'grey50': [((128, 128, 128), (0, 0, 50), 'Grey50', 244)], 'grey53': [((135, 135, 135), (0, 0, 53), 'Grey53', 102)], 'grey54': [((138, 138, 138), (0, 0, 54), 'Grey54', 245)], 'grey58': [((148, 148, 148), (0, 0, 58), 'Grey58', 246)], 'grey62': [((158, 158, 158), (0, 0, 62), 'Grey62', 247)], 'grey63': [((175, 135, 175), (300, 20, 61), 'Grey63', 139)], 'grey66': [((168, 168, 168), (0, 0, 66), 'Grey66', 248)], 'grey69': [((175, 175, 175), (0, 0, 69), 'Grey69', 145)], 'grey7': [((18, 18, 18), (0, 0, 7), 'Grey7', 233)], 'grey70': [((178, 178, 178), (0, 0, 70), 'Grey70', 249)], 'grey74': [((188, 188, 188), (0, 0, 74), 'Grey74', 250)], 'grey78': [((198, 198, 198), (0, 0, 78), 'Grey78', 251)], 'grey82': [((208, 208, 208), (0, 0, 82), 'Grey82', 252)], 'grey84': [((215, 215, 215), (0, 0, 84), 'Grey84', 188)], 'grey85': [((218, 218, 218), (0, 0, 85), 'Grey85', 253)], 'grey89': [((228, 228, 228), (0, 0, 89), 'Grey89', 254)], 'grey93': [((238, 238, 238), (0, 0, 93), 'Grey93', 255)], 'honeydew2': [((215, 255, 215), (120, 100, 92), 'Honeydew2', 194)], 'hotpink': [((255, 95, 175), (330, 100, 69), 'HotPink', 205), ((255, 95, 215), (315, 100, 69), 'HotPink', 206)], 'hotpink2': [((215, 95, 175), (320, 60, 61), 'HotPink2', 169)], 'hotpink3': [((175, 95, 135), (330, 33, 53), 'HotPink3', 132), ((215, 95, 135), (340, 60, 61), 'HotPink3', 168)], 'indianred': [((175, 95, 95), (0, 33, 53), 'IndianRed', 131), ((215, 95, 95), (0, 60, 61), 'IndianRed', 167)], 'indianred1': [((255, 95, 95), (0, 100, 69), 'IndianRed1', 203), ((255, 95, 135), (345, 100, 69), 'IndianRed1', 204)], 'khaki1': [((255, 255, 135), (60, 100, 76), 'Khaki1', 228)], 'khaki3': [((215, 215, 95), (60, 60, 61), 'Khaki3', 185)], 'lightcoral': [((255, 135, 135), (0, 100, 76), 'LightCoral', 210)], 'lightcyan1': [((215, 255, 255), (180, 100, 92), 'LightCyan1', 195)], 'lightcyan3': [((175, 215, 215), (180, 33, 76), 'LightCyan3', 152)], 'lightgoldenrod1': [((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227)], 'lightgoldenrod2': [((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186), ((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221), ((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222)], 'lightgoldenrod3': [((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179)], 'lightgreen': [((135, 255, 95), (105, 100, 69), 'LightGreen', 119), ((135, 255, 135), (120, 100, 76), 'LightGreen', 120)], 'lightpink1': [((255, 175, 175), (0, 100, 84), 'LightPink1', 217)], 'lightpink3': [((215, 135, 135), (0, 50, 69), 'LightPink3', 174)], 'lightpink4': [((135, 95, 95), (0, 17, 45), 'LightPink4', 95)], 'lightsalmon1': [((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216)], 'lightsalmon3': [((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137), ((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173)], 'lightseagreen': [((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37)], 'lightskyblue1': [((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153)], 'lightskyblue3': [((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109), ((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110)], 'lightslateblue': [((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105)], 'lightslategrey': [((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103)], 'lightsteelblue': [((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147)], 'lightsteelblue1': [((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189)], 'lightsteelblue3': [((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146)], 'lightyellow3': [((215, 215, 175), (60, 33, 76), 'LightYellow3', 187)], 'lime': [((0, 255, 0), (120, 100, 50), 'Lime', 10)], 'magenta1': [((255, 0, 255), (300, 100, 50), 'Magenta1', 201)], 'magenta2': [((215, 0, 255), (291, 100, 50), 'Magenta2', 165), ((255, 0, 215), (309, 100, 50), 'Magenta2', 200)], 'magenta3': [((175, 0, 175), (300, 100, 34), 'Magenta3', 127), ((215, 0, 175), (311, 100, 42), 'Magenta3', 163), ((215, 0, 215), (300, 100, 42), 'Magenta3', 164)], 'maroon': [((128, 0, 0), (0, 100, 25), 'Maroon', 1)], 'mediumorchid': [((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134)], 'mediumorchid1': [((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171), ((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207)], 'mediumorchid3': [((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133)], 'mediumpurple': [((135, 135, 215), (240, 50, 69), 'MediumPurple', 104)], 'mediumpurple1': [((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141)], 'mediumpurple2': [((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135), ((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140)], 'mediumpurple3': [((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97), ((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98)], 'mediumpurple4': [((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60)], 'mediumspringgreen': [((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49)], 'mediumturquoise': [((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80)], 'mediumvioletred': [((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126)], 'mistyrose1': [((255, 215, 215), (0, 100, 92), 'MistyRose1', 224)], 'mistyrose3': [((215, 175, 175), (0, 33, 76), 'MistyRose3', 181)], 'navajowhite1': [((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223)], 'navajowhite3': [((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144)], 'navy': [((0, 0, 128), (240, 100, 25), 'Navy', 4)], 'navyblue': [((0, 0, 95), (240, 100, 19), 'NavyBlue', 17)], 'olive': [((128, 128, 0), (60, 100, 25), 'Olive', 3)], 'orange1': [((255, 175, 0), (41, 100, 50), 'Orange1', 214)], 'orange3': [((215, 135, 0), (38, 100, 42), 'Orange3', 172)], 'orange4': [((95, 95, 0), (60, 100, 19), 'Orange4', 58), ((135, 95, 0), (42, 100, 26), 'Orange4', 94)], 'orangered1': [((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202)], 'orchid': [((215, 95, 215), (300, 60, 61), 'Orchid', 170)], 'orchid1': [((255, 135, 255), (300, 100, 76), 'Orchid1', 213)], 'orchid2': [((255, 135, 215), (320, 100, 76), 'Orchid2', 212)], 'palegreen1': [((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121), ((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156)], 'palegreen3': [((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77), ((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114)], 'paleturquoise1': [((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159)], 'paleturquoise4': [((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66)], 'palevioletred1': [((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211)], 'pink1': [((255, 175, 215), (330, 100, 84), 'Pink1', 218)], 'pink3': [((215, 135, 175), (330, 50, 69), 'Pink3', 175)], 'plum1': [((255, 175, 255), (300, 100, 84), 'Plum1', 219)], 'plum2': [((215, 175, 255), (270, 100, 84), 'Plum2', 183)], 'plum3': [((215, 135, 215), (300, 50, 69), 'Plum3', 176)], 'plum4': [((135, 95, 135), (300, 17, 45), 'Plum4', 96)], 'purple': [((128, 0, 128), (300, 100, 25), 'Purple', 5), ((135, 0, 255), (272, 100, 50), 'Purple', 93), ((175, 0, 255), (281, 100, 50), 'Purple', 129)], 'purple3': [((95, 0, 215), (267, 100, 42), 'Purple3', 56)], 'purple4': [((95, 0, 135), (282, 100, 26), 'Purple4', 54), ((95, 0, 175), (273, 100, 34), 'Purple4', 55)], 'red': [((255, 0, 0), (0, 100, 50), 'Red', 9)], 'red1': [((255, 0, 0), (0, 100, 50), 'Red1', 196)], 'red3': [((175, 0, 0), (0, 100, 34), 'Red3', 124), ((215, 0, 0), (0, 100, 42), 'Red3', 160)], 'rosybrown': [((175, 135, 135), (0, 20, 61), 'RosyBrown', 138)], 'royalblue1': [((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63)], 'salmon1': [((255, 135, 95), (15, 100, 69), 'Salmon1', 209)], 'sandybrown': [((255, 175, 95), (30, 100, 69), 'SandyBrown', 215)], 'seagreen1': [((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84), ((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85)], 'seagreen2': [((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83)], 'seagreen3': [((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78)], 'silver': [((192, 192, 192), (0, 0, 75), 'Silver', 7)], 'skyblue1': [((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117)], 'skyblue2': [((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111)], 'skyblue3': [((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74)], 'slateblue1': [((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99)], 'slateblue3': [((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61), ((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62)], 'springgreen1': [((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48)], 'springgreen2': [((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42), ((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47)], 'springgreen3': [((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35), ((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41)], 'springgreen4': [((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29)], 'steelblue': [((95, 135, 175), (210, 33, 53), 'SteelBlue', 67)], 'steelblue1': [((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75), ((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81)], 'steelblue3': [((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68)], 'tan': [((215, 175, 135), (30, 50, 69), 'Tan', 180)], 'teal': [((0, 128, 128), (180, 100, 25), 'Teal', 6)], 'thistle1': [((255, 215, 255), (300, 100, 92), 'Thistle1', 225)], 'thistle3': [((215, 175, 215), (300, 33, 76), 'Thistle3', 182)], 'turquoise2': [((0, 215, 255), (189, 100, 50), 'Turquoise2', 45)], 'turquoise4': [((0, 135, 135), (180, 100, 26), 'Turquoise4', 30)], 'violet': [((215, 135, 255), (280, 100, 76), 'Violet', 177)], 'wheat1': [((255, 255, 175), (60, 100, 84), 'Wheat1', 229)], 'wheat4': [((135, 135, 95), (60, 17, 45), 'Wheat4', 101)], 'white': [((255, 255, 255), (0, 0, 100), 'White', 15)], 'yellow': [((255, 255, 0), (60, 100, 50), 'Yellow', 11)], 'yellow1': [((255, 255, 0), (60, 100, 50), 'Yellow1', 226)], 'yellow2': [((215, 255, 0), (69, 100, 50), 'Yellow2', 190)], 'yellow3': [((175, 215, 0), (71, 100, 42), 'Yellow3', 148), ((215, 215, 0), (60, 100, 42), 'Yellow3', 184)], 'yellow4': [((135, 135, 0), (60, 100, 26), 'Yellow4', 100), ((135, 175, 0), (74, 100, 34), 'Yellow4', 106)]}

Registered colors keyed by name.lower().

by_name: ClassVar[defaultdict[str, list[Color]]] = {'Aqua': [((0, 255, 255), (180, 100, 50), 'Aqua', 14)], 'Aquamarine1': [((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86), ((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122)], 'Aquamarine3': [((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79)], 'Black': [((0, 0, 0), (0, 0, 0), 'Black', 0)], 'Blue': [((0, 0, 255), (240, 100, 50), 'Blue', 12)], 'Blue1': [((0, 0, 255), (240, 100, 50), 'Blue1', 21)], 'Blue3': [((0, 0, 175), (240, 100, 34), 'Blue3', 19), ((0, 0, 215), (240, 100, 42), 'Blue3', 20)], 'BlueViolet': [((95, 0, 255), (262, 100, 50), 'BlueViolet', 57)], 'CadetBlue': [((95, 175, 135), (150, 33, 53), 'CadetBlue', 72), ((95, 175, 175), (180, 33, 53), 'CadetBlue', 73)], 'Chartreuse1': [((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118)], 'Chartreuse2': [((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82), ((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112)], 'Chartreuse3': [((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70), ((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76)], 'Chartreuse4': [((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64)], 'CornflowerBlue': [((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69)], 'Cornsilk1': [((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230)], 'Cyan1': [((0, 255, 255), (180, 100, 50), 'Cyan1', 51)], 'Cyan2': [((0, 255, 215), (171, 100, 50), 'Cyan2', 50)], 'Cyan3': [((0, 215, 175), (169, 100, 42), 'Cyan3', 43)], 'DarkBlue': [((0, 0, 135), (240, 100, 26), 'DarkBlue', 18)], 'DarkCyan': [((0, 175, 135), (166, 100, 34), 'DarkCyan', 36)], 'DarkGoldenrod': [((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136)], 'DarkGreen': [((0, 95, 0), (120, 100, 19), 'DarkGreen', 22)], 'DarkKhaki': [((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143)], 'DarkMagenta': [((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90), ((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91)], 'DarkOliveGreen1': [((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191), ((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192)], 'DarkOliveGreen2': [((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155)], 'DarkOliveGreen3': [((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107), ((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113), ((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149)], 'DarkOrange': [((255, 135, 0), (32, 100, 50), 'DarkOrange', 208)], 'DarkOrange3': [((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130), ((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166)], 'DarkRed': [((95, 0, 0), (0, 100, 19), 'DarkRed', 52), ((135, 0, 0), (0, 100, 26), 'DarkRed', 88)], 'DarkSeaGreen': [((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108)], 'DarkSeaGreen1': [((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158), ((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193)], 'DarkSeaGreen2': [((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151), ((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157)], 'DarkSeaGreen3': [((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115), ((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150)], 'DarkSeaGreen4': [((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65), ((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71)], 'DarkSlateGray1': [((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123)], 'DarkSlateGray2': [((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87)], 'DarkSlateGray3': [((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116)], 'DarkTurquoise': [((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44)], 'DarkViolet': [((135, 0, 215), (278, 100, 42), 'DarkViolet', 92), ((175, 0, 215), (289, 100, 42), 'DarkViolet', 128)], 'DeepPink1': [((255, 0, 135), (328, 100, 50), 'DeepPink1', 198), ((255, 0, 175), (319, 100, 50), 'DeepPink1', 199)], 'DeepPink2': [((255, 0, 95), (338, 100, 50), 'DeepPink2', 197)], 'DeepPink3': [((215, 0, 95), (333, 100, 42), 'DeepPink3', 161), ((215, 0, 135), (322, 100, 42), 'DeepPink3', 162)], 'DeepPink4': [((95, 0, 95), (300, 100, 19), 'DeepPink4', 53), ((135, 0, 95), (318, 100, 26), 'DeepPink4', 89), ((175, 0, 95), (327, 100, 34), 'DeepPink4', 125)], 'DeepSkyBlue1': [((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39)], 'DeepSkyBlue2': [((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38)], 'DeepSkyBlue3': [((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31), ((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32)], 'DeepSkyBlue4': [((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23), ((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24), ((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25)], 'DodgerBlue1': [((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33)], 'DodgerBlue2': [((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27)], 'DodgerBlue3': [((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26)], 'Fuchsia': [((255, 0, 255), (300, 100, 50), 'Fuchsia', 13)], 'Gold1': [((255, 215, 0), (51, 100, 50), 'Gold1', 220)], 'Gold3': [((175, 175, 0), (60, 100, 34), 'Gold3', 142), ((215, 175, 0), (49, 100, 42), 'Gold3', 178)], 'Green': [((0, 128, 0), (120, 100, 25), 'Green', 2)], 'Green1': [((0, 255, 0), (120, 100, 50), 'Green1', 46)], 'Green3': [((0, 175, 0), (120, 100, 34), 'Green3', 34), ((0, 215, 0), (120, 100, 42), 'Green3', 40)], 'Green4': [((0, 135, 0), (120, 100, 26), 'Green4', 28)], 'GreenYellow': [((175, 255, 0), (79, 100, 50), 'GreenYellow', 154)], 'Grey': [((128, 128, 128), (0, 0, 50), 'Grey', 8)], 'Grey0': [((0, 0, 0), (0, 0, 0), 'Grey0', 16)], 'Grey100': [((255, 255, 255), (0, 0, 100), 'Grey100', 231)], 'Grey11': [((28, 28, 28), (0, 0, 11), 'Grey11', 234)], 'Grey15': [((38, 38, 38), (0, 0, 15), 'Grey15', 235)], 'Grey19': [((48, 48, 48), (0, 0, 19), 'Grey19', 236)], 'Grey23': [((58, 58, 58), (0, 0, 23), 'Grey23', 237)], 'Grey27': [((68, 68, 68), (0, 0, 27), 'Grey27', 238)], 'Grey3': [((8, 8, 8), (0, 0, 3), 'Grey3', 232)], 'Grey30': [((78, 78, 78), (0, 0, 31), 'Grey30', 239)], 'Grey35': [((88, 88, 88), (0, 0, 35), 'Grey35', 240)], 'Grey37': [((95, 95, 95), (0, 0, 37), 'Grey37', 59)], 'Grey39': [((98, 98, 98), (0, 0, 38), 'Grey39', 241)], 'Grey42': [((108, 108, 108), (0, 0, 42), 'Grey42', 242)], 'Grey46': [((118, 118, 118), (0, 0, 46), 'Grey46', 243)], 'Grey50': [((128, 128, 128), (0, 0, 50), 'Grey50', 244)], 'Grey53': [((135, 135, 135), (0, 0, 53), 'Grey53', 102)], 'Grey54': [((138, 138, 138), (0, 0, 54), 'Grey54', 245)], 'Grey58': [((148, 148, 148), (0, 0, 58), 'Grey58', 246)], 'Grey62': [((158, 158, 158), (0, 0, 62), 'Grey62', 247)], 'Grey63': [((175, 135, 175), (300, 20, 61), 'Grey63', 139)], 'Grey66': [((168, 168, 168), (0, 0, 66), 'Grey66', 248)], 'Grey69': [((175, 175, 175), (0, 0, 69), 'Grey69', 145)], 'Grey7': [((18, 18, 18), (0, 0, 7), 'Grey7', 233)], 'Grey70': [((178, 178, 178), (0, 0, 70), 'Grey70', 249)], 'Grey74': [((188, 188, 188), (0, 0, 74), 'Grey74', 250)], 'Grey78': [((198, 198, 198), (0, 0, 78), 'Grey78', 251)], 'Grey82': [((208, 208, 208), (0, 0, 82), 'Grey82', 252)], 'Grey84': [((215, 215, 215), (0, 0, 84), 'Grey84', 188)], 'Grey85': [((218, 218, 218), (0, 0, 85), 'Grey85', 253)], 'Grey89': [((228, 228, 228), (0, 0, 89), 'Grey89', 254)], 'Grey93': [((238, 238, 238), (0, 0, 93), 'Grey93', 255)], 'Honeydew2': [((215, 255, 215), (120, 100, 92), 'Honeydew2', 194)], 'HotPink': [((255, 95, 175), (330, 100, 69), 'HotPink', 205), ((255, 95, 215), (315, 100, 69), 'HotPink', 206)], 'HotPink2': [((215, 95, 175), (320, 60, 61), 'HotPink2', 169)], 'HotPink3': [((175, 95, 135), (330, 33, 53), 'HotPink3', 132), ((215, 95, 135), (340, 60, 61), 'HotPink3', 168)], 'IndianRed': [((175, 95, 95), (0, 33, 53), 'IndianRed', 131), ((215, 95, 95), (0, 60, 61), 'IndianRed', 167)], 'IndianRed1': [((255, 95, 95), (0, 100, 69), 'IndianRed1', 203), ((255, 95, 135), (345, 100, 69), 'IndianRed1', 204)], 'Khaki1': [((255, 255, 135), (60, 100, 76), 'Khaki1', 228)], 'Khaki3': [((215, 215, 95), (60, 60, 61), 'Khaki3', 185)], 'LightCoral': [((255, 135, 135), (0, 100, 76), 'LightCoral', 210)], 'LightCyan1': [((215, 255, 255), (180, 100, 92), 'LightCyan1', 195)], 'LightCyan3': [((175, 215, 215), (180, 33, 76), 'LightCyan3', 152)], 'LightGoldenrod1': [((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227)], 'LightGoldenrod2': [((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186), ((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221), ((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222)], 'LightGoldenrod3': [((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179)], 'LightGreen': [((135, 255, 95), (105, 100, 69), 'LightGreen', 119), ((135, 255, 135), (120, 100, 76), 'LightGreen', 120)], 'LightPink1': [((255, 175, 175), (0, 100, 84), 'LightPink1', 217)], 'LightPink3': [((215, 135, 135), (0, 50, 69), 'LightPink3', 174)], 'LightPink4': [((135, 95, 95), (0, 17, 45), 'LightPink4', 95)], 'LightSalmon1': [((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216)], 'LightSalmon3': [((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137), ((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173)], 'LightSeaGreen': [((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37)], 'LightSkyBlue1': [((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153)], 'LightSkyBlue3': [((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109), ((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110)], 'LightSlateBlue': [((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105)], 'LightSlateGrey': [((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103)], 'LightSteelBlue': [((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147)], 'LightSteelBlue1': [((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189)], 'LightSteelBlue3': [((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146)], 'LightYellow3': [((215, 215, 175), (60, 33, 76), 'LightYellow3', 187)], 'Lime': [((0, 255, 0), (120, 100, 50), 'Lime', 10)], 'Magenta1': [((255, 0, 255), (300, 100, 50), 'Magenta1', 201)], 'Magenta2': [((215, 0, 255), (291, 100, 50), 'Magenta2', 165), ((255, 0, 215), (309, 100, 50), 'Magenta2', 200)], 'Magenta3': [((175, 0, 175), (300, 100, 34), 'Magenta3', 127), ((215, 0, 175), (311, 100, 42), 'Magenta3', 163), ((215, 0, 215), (300, 100, 42), 'Magenta3', 164)], 'Maroon': [((128, 0, 0), (0, 100, 25), 'Maroon', 1)], 'MediumOrchid': [((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134)], 'MediumOrchid1': [((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171), ((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207)], 'MediumOrchid3': [((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133)], 'MediumPurple': [((135, 135, 215), (240, 50, 69), 'MediumPurple', 104)], 'MediumPurple1': [((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141)], 'MediumPurple2': [((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135), ((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140)], 'MediumPurple3': [((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97), ((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98)], 'MediumPurple4': [((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60)], 'MediumSpringGreen': [((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49)], 'MediumTurquoise': [((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80)], 'MediumVioletRed': [((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126)], 'MistyRose1': [((255, 215, 215), (0, 100, 92), 'MistyRose1', 224)], 'MistyRose3': [((215, 175, 175), (0, 33, 76), 'MistyRose3', 181)], 'NavajoWhite1': [((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223)], 'NavajoWhite3': [((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144)], 'Navy': [((0, 0, 128), (240, 100, 25), 'Navy', 4)], 'NavyBlue': [((0, 0, 95), (240, 100, 19), 'NavyBlue', 17)], 'Olive': [((128, 128, 0), (60, 100, 25), 'Olive', 3)], 'Orange1': [((255, 175, 0), (41, 100, 50), 'Orange1', 214)], 'Orange3': [((215, 135, 0), (38, 100, 42), 'Orange3', 172)], 'Orange4': [((95, 95, 0), (60, 100, 19), 'Orange4', 58), ((135, 95, 0), (42, 100, 26), 'Orange4', 94)], 'OrangeRed1': [((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202)], 'Orchid': [((215, 95, 215), (300, 60, 61), 'Orchid', 170)], 'Orchid1': [((255, 135, 255), (300, 100, 76), 'Orchid1', 213)], 'Orchid2': [((255, 135, 215), (320, 100, 76), 'Orchid2', 212)], 'PaleGreen1': [((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121), ((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156)], 'PaleGreen3': [((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77), ((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114)], 'PaleTurquoise1': [((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159)], 'PaleTurquoise4': [((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66)], 'PaleVioletRed1': [((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211)], 'Pink1': [((255, 175, 215), (330, 100, 84), 'Pink1', 218)], 'Pink3': [((215, 135, 175), (330, 50, 69), 'Pink3', 175)], 'Plum1': [((255, 175, 255), (300, 100, 84), 'Plum1', 219)], 'Plum2': [((215, 175, 255), (270, 100, 84), 'Plum2', 183)], 'Plum3': [((215, 135, 215), (300, 50, 69), 'Plum3', 176)], 'Plum4': [((135, 95, 135), (300, 17, 45), 'Plum4', 96)], 'Purple': [((128, 0, 128), (300, 100, 25), 'Purple', 5), ((135, 0, 255), (272, 100, 50), 'Purple', 93), ((175, 0, 255), (281, 100, 50), 'Purple', 129)], 'Purple3': [((95, 0, 215), (267, 100, 42), 'Purple3', 56)], 'Purple4': [((95, 0, 135), (282, 100, 26), 'Purple4', 54), ((95, 0, 175), (273, 100, 34), 'Purple4', 55)], 'Red': [((255, 0, 0), (0, 100, 50), 'Red', 9)], 'Red1': [((255, 0, 0), (0, 100, 50), 'Red1', 196)], 'Red3': [((175, 0, 0), (0, 100, 34), 'Red3', 124), ((215, 0, 0), (0, 100, 42), 'Red3', 160)], 'RosyBrown': [((175, 135, 135), (0, 20, 61), 'RosyBrown', 138)], 'RoyalBlue1': [((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63)], 'Salmon1': [((255, 135, 95), (15, 100, 69), 'Salmon1', 209)], 'SandyBrown': [((255, 175, 95), (30, 100, 69), 'SandyBrown', 215)], 'SeaGreen1': [((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84), ((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85)], 'SeaGreen2': [((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83)], 'SeaGreen3': [((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78)], 'Silver': [((192, 192, 192), (0, 0, 75), 'Silver', 7)], 'SkyBlue1': [((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117)], 'SkyBlue2': [((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111)], 'SkyBlue3': [((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74)], 'SlateBlue1': [((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99)], 'SlateBlue3': [((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61), ((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62)], 'SpringGreen1': [((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48)], 'SpringGreen2': [((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42), ((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47)], 'SpringGreen3': [((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35), ((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41)], 'SpringGreen4': [((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29)], 'SteelBlue': [((95, 135, 175), (210, 33, 53), 'SteelBlue', 67)], 'SteelBlue1': [((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75), ((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81)], 'SteelBlue3': [((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68)], 'Tan': [((215, 175, 135), (30, 50, 69), 'Tan', 180)], 'Teal': [((0, 128, 128), (180, 100, 25), 'Teal', 6)], 'Thistle1': [((255, 215, 255), (300, 100, 92), 'Thistle1', 225)], 'Thistle3': [((215, 175, 215), (300, 33, 76), 'Thistle3', 182)], 'Turquoise2': [((0, 215, 255), (189, 100, 50), 'Turquoise2', 45)], 'Turquoise4': [((0, 135, 135), (180, 100, 26), 'Turquoise4', 30)], 'Violet': [((215, 135, 255), (280, 100, 76), 'Violet', 177)], 'Wheat1': [((255, 255, 175), (60, 100, 84), 'Wheat1', 229)], 'Wheat4': [((135, 135, 95), (60, 17, 45), 'Wheat4', 101)], 'White': [((255, 255, 255), (0, 0, 100), 'White', 15)], 'Yellow': [((255, 255, 0), (60, 100, 50), 'Yellow', 11)], 'Yellow1': [((255, 255, 0), (60, 100, 50), 'Yellow1', 226)], 'Yellow2': [((215, 255, 0), (69, 100, 50), 'Yellow2', 190)], 'Yellow3': [((175, 215, 0), (71, 100, 42), 'Yellow3', 148), ((215, 215, 0), (60, 100, 42), 'Yellow3', 184)], 'Yellow4': [((135, 135, 0), (60, 100, 26), 'Yellow4', 100), ((135, 175, 0), (74, 100, 34), 'Yellow4', 106)]}

Registered colors keyed by name, as given.

by_rgb: ClassVar[defaultdict[RGB, list[Color]]] = {(0, 0, 0): [((0, 0, 0), (0, 0, 0), 'Black', 0), ((0, 0, 0), (0, 0, 0), 'Grey0', 16)], (0, 0, 95): [((0, 0, 95), (240, 100, 19), 'NavyBlue', 17)], (0, 0, 128): [((0, 0, 128), (240, 100, 25), 'Navy', 4)], (0, 0, 135): [((0, 0, 135), (240, 100, 26), 'DarkBlue', 18)], (0, 0, 175): [((0, 0, 175), (240, 100, 34), 'Blue3', 19)], (0, 0, 215): [((0, 0, 215), (240, 100, 42), 'Blue3', 20)], (0, 0, 255): [((0, 0, 255), (240, 100, 50), 'Blue', 12), ((0, 0, 255), (240, 100, 50), 'Blue1', 21)], (0, 95, 0): [((0, 95, 0), (120, 100, 19), 'DarkGreen', 22)], (0, 95, 95): [((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23)], (0, 95, 135): [((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24)], (0, 95, 175): [((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25)], (0, 95, 215): [((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26)], (0, 95, 255): [((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27)], (0, 128, 0): [((0, 128, 0), (120, 100, 25), 'Green', 2)], (0, 128, 128): [((0, 128, 128), (180, 100, 25), 'Teal', 6)], (0, 135, 0): [((0, 135, 0), (120, 100, 26), 'Green4', 28)], (0, 135, 95): [((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29)], (0, 135, 135): [((0, 135, 135), (180, 100, 26), 'Turquoise4', 30)], (0, 135, 175): [((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31)], (0, 135, 215): [((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32)], (0, 135, 255): [((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33)], (0, 175, 0): [((0, 175, 0), (120, 100, 34), 'Green3', 34)], (0, 175, 95): [((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35)], (0, 175, 135): [((0, 175, 135), (166, 100, 34), 'DarkCyan', 36)], (0, 175, 175): [((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37)], (0, 175, 215): [((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38)], (0, 175, 255): [((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39)], (0, 215, 0): [((0, 215, 0), (120, 100, 42), 'Green3', 40)], (0, 215, 95): [((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41)], (0, 215, 135): [((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42)], (0, 215, 175): [((0, 215, 175), (169, 100, 42), 'Cyan3', 43)], (0, 215, 215): [((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44)], (0, 215, 255): [((0, 215, 255), (189, 100, 50), 'Turquoise2', 45)], (0, 255, 0): [((0, 255, 0), (120, 100, 50), 'Lime', 10), ((0, 255, 0), (120, 100, 50), 'Green1', 46)], (0, 255, 95): [((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47)], (0, 255, 135): [((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48)], (0, 255, 175): [((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49)], (0, 255, 215): [((0, 255, 215), (171, 100, 50), 'Cyan2', 50)], (0, 255, 255): [((0, 255, 255), (180, 100, 50), 'Aqua', 14), ((0, 255, 255), (180, 100, 50), 'Cyan1', 51)], (8, 8, 8): [((8, 8, 8), (0, 0, 3), 'Grey3', 232)], (18, 18, 18): [((18, 18, 18), (0, 0, 7), 'Grey7', 233)], (28, 28, 28): [((28, 28, 28), (0, 0, 11), 'Grey11', 234)], (38, 38, 38): [((38, 38, 38), (0, 0, 15), 'Grey15', 235)], (48, 48, 48): [((48, 48, 48), (0, 0, 19), 'Grey19', 236)], (58, 58, 58): [((58, 58, 58), (0, 0, 23), 'Grey23', 237)], (68, 68, 68): [((68, 68, 68), (0, 0, 27), 'Grey27', 238)], (78, 78, 78): [((78, 78, 78), (0, 0, 31), 'Grey30', 239)], (88, 88, 88): [((88, 88, 88), (0, 0, 35), 'Grey35', 240)], (95, 0, 0): [((95, 0, 0), (0, 100, 19), 'DarkRed', 52)], (95, 0, 95): [((95, 0, 95), (300, 100, 19), 'DeepPink4', 53)], (95, 0, 135): [((95, 0, 135), (282, 100, 26), 'Purple4', 54)], (95, 0, 175): [((95, 0, 175), (273, 100, 34), 'Purple4', 55)], (95, 0, 215): [((95, 0, 215), (267, 100, 42), 'Purple3', 56)], (95, 0, 255): [((95, 0, 255), (262, 100, 50), 'BlueViolet', 57)], (95, 95, 0): [((95, 95, 0), (60, 100, 19), 'Orange4', 58)], (95, 95, 95): [((95, 95, 95), (0, 0, 37), 'Grey37', 59)], (95, 95, 135): [((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60)], (95, 95, 175): [((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61)], (95, 95, 215): [((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62)], (95, 95, 255): [((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63)], (95, 135, 0): [((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64)], (95, 135, 95): [((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65)], (95, 135, 135): [((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66)], (95, 135, 175): [((95, 135, 175), (210, 33, 53), 'SteelBlue', 67)], (95, 135, 215): [((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68)], (95, 135, 255): [((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69)], (95, 175, 0): [((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70)], (95, 175, 95): [((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71)], (95, 175, 135): [((95, 175, 135), (150, 33, 53), 'CadetBlue', 72)], (95, 175, 175): [((95, 175, 175), (180, 33, 53), 'CadetBlue', 73)], (95, 175, 215): [((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74)], (95, 175, 255): [((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75)], (95, 215, 0): [((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76)], (95, 215, 95): [((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77)], (95, 215, 135): [((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78)], (95, 215, 175): [((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79)], (95, 215, 215): [((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80)], (95, 215, 255): [((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81)], (95, 255, 0): [((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82)], (95, 255, 95): [((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83)], (95, 255, 135): [((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84)], (95, 255, 175): [((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85)], (95, 255, 215): [((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86)], (95, 255, 255): [((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87)], (98, 98, 98): [((98, 98, 98), (0, 0, 38), 'Grey39', 241)], (108, 108, 108): [((108, 108, 108), (0, 0, 42), 'Grey42', 242)], (118, 118, 118): [((118, 118, 118), (0, 0, 46), 'Grey46', 243)], (128, 0, 0): [((128, 0, 0), (0, 100, 25), 'Maroon', 1)], (128, 0, 128): [((128, 0, 128), (300, 100, 25), 'Purple', 5)], (128, 128, 0): [((128, 128, 0), (60, 100, 25), 'Olive', 3)], (128, 128, 128): [((128, 128, 128), (0, 0, 50), 'Grey', 8), ((128, 128, 128), (0, 0, 50), 'Grey50', 244)], (135, 0, 0): [((135, 0, 0), (0, 100, 26), 'DarkRed', 88)], (135, 0, 95): [((135, 0, 95), (318, 100, 26), 'DeepPink4', 89)], (135, 0, 135): [((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90)], (135, 0, 175): [((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91)], (135, 0, 215): [((135, 0, 215), (278, 100, 42), 'DarkViolet', 92)], (135, 0, 255): [((135, 0, 255), (272, 100, 50), 'Purple', 93)], (135, 95, 0): [((135, 95, 0), (42, 100, 26), 'Orange4', 94)], (135, 95, 95): [((135, 95, 95), (0, 17, 45), 'LightPink4', 95)], (135, 95, 135): [((135, 95, 135), (300, 17, 45), 'Plum4', 96)], (135, 95, 175): [((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97)], (135, 95, 215): [((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98)], (135, 95, 255): [((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99)], (135, 135, 0): [((135, 135, 0), (60, 100, 26), 'Yellow4', 100)], (135, 135, 95): [((135, 135, 95), (60, 17, 45), 'Wheat4', 101)], (135, 135, 135): [((135, 135, 135), (0, 0, 53), 'Grey53', 102)], (135, 135, 175): [((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103)], (135, 135, 215): [((135, 135, 215), (240, 50, 69), 'MediumPurple', 104)], (135, 135, 255): [((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105)], (135, 175, 0): [((135, 175, 0), (74, 100, 34), 'Yellow4', 106)], (135, 175, 95): [((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107)], (135, 175, 135): [((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108)], (135, 175, 175): [((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109)], (135, 175, 215): [((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110)], (135, 175, 255): [((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111)], (135, 215, 0): [((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112)], (135, 215, 95): [((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113)], (135, 215, 135): [((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114)], (135, 215, 175): [((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115)], (135, 215, 215): [((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116)], (135, 215, 255): [((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117)], (135, 255, 0): [((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118)], (135, 255, 95): [((135, 255, 95), (105, 100, 69), 'LightGreen', 119)], (135, 255, 135): [((135, 255, 135), (120, 100, 76), 'LightGreen', 120)], (135, 255, 175): [((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121)], (135, 255, 215): [((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122)], (135, 255, 255): [((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123)], (138, 138, 138): [((138, 138, 138), (0, 0, 54), 'Grey54', 245)], (148, 148, 148): [((148, 148, 148), (0, 0, 58), 'Grey58', 246)], (158, 158, 158): [((158, 158, 158), (0, 0, 62), 'Grey62', 247)], (168, 168, 168): [((168, 168, 168), (0, 0, 66), 'Grey66', 248)], (175, 0, 0): [((175, 0, 0), (0, 100, 34), 'Red3', 124)], (175, 0, 95): [((175, 0, 95), (327, 100, 34), 'DeepPink4', 125)], (175, 0, 135): [((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126)], (175, 0, 175): [((175, 0, 175), (300, 100, 34), 'Magenta3', 127)], (175, 0, 215): [((175, 0, 215), (289, 100, 42), 'DarkViolet', 128)], (175, 0, 255): [((175, 0, 255), (281, 100, 50), 'Purple', 129)], (175, 95, 0): [((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130)], (175, 95, 95): [((175, 95, 95), (0, 33, 53), 'IndianRed', 131)], (175, 95, 135): [((175, 95, 135), (330, 33, 53), 'HotPink3', 132)], (175, 95, 175): [((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133)], (175, 95, 215): [((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134)], (175, 95, 255): [((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135)], (175, 135, 0): [((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136)], (175, 135, 95): [((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137)], (175, 135, 135): [((175, 135, 135), (0, 20, 61), 'RosyBrown', 138)], (175, 135, 175): [((175, 135, 175), (300, 20, 61), 'Grey63', 139)], (175, 135, 215): [((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140)], (175, 135, 255): [((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141)], (175, 175, 0): [((175, 175, 0), (60, 100, 34), 'Gold3', 142)], (175, 175, 95): [((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143)], (175, 175, 135): [((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144)], (175, 175, 175): [((175, 175, 175), (0, 0, 69), 'Grey69', 145)], (175, 175, 215): [((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146)], (175, 175, 255): [((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147)], (175, 215, 0): [((175, 215, 0), (71, 100, 42), 'Yellow3', 148)], (175, 215, 95): [((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149)], (175, 215, 135): [((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150)], (175, 215, 175): [((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151)], (175, 215, 215): [((175, 215, 215), (180, 33, 76), 'LightCyan3', 152)], (175, 215, 255): [((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153)], (175, 255, 0): [((175, 255, 0), (79, 100, 50), 'GreenYellow', 154)], (175, 255, 95): [((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155)], (175, 255, 135): [((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156)], (175, 255, 175): [((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157)], (175, 255, 215): [((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158)], (175, 255, 255): [((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159)], (178, 178, 178): [((178, 178, 178), (0, 0, 70), 'Grey70', 249)], (188, 188, 188): [((188, 188, 188), (0, 0, 74), 'Grey74', 250)], (192, 192, 192): [((192, 192, 192), (0, 0, 75), 'Silver', 7)], (198, 198, 198): [((198, 198, 198), (0, 0, 78), 'Grey78', 251)], (208, 208, 208): [((208, 208, 208), (0, 0, 82), 'Grey82', 252)], (215, 0, 0): [((215, 0, 0), (0, 100, 42), 'Red3', 160)], (215, 0, 95): [((215, 0, 95), (333, 100, 42), 'DeepPink3', 161)], (215, 0, 135): [((215, 0, 135), (322, 100, 42), 'DeepPink3', 162)], (215, 0, 175): [((215, 0, 175), (311, 100, 42), 'Magenta3', 163)], (215, 0, 215): [((215, 0, 215), (300, 100, 42), 'Magenta3', 164)], (215, 0, 255): [((215, 0, 255), (291, 100, 50), 'Magenta2', 165)], (215, 95, 0): [((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166)], (215, 95, 95): [((215, 95, 95), (0, 60, 61), 'IndianRed', 167)], (215, 95, 135): [((215, 95, 135), (340, 60, 61), 'HotPink3', 168)], (215, 95, 175): [((215, 95, 175), (320, 60, 61), 'HotPink2', 169)], (215, 95, 215): [((215, 95, 215), (300, 60, 61), 'Orchid', 170)], (215, 95, 255): [((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171)], (215, 135, 0): [((215, 135, 0), (38, 100, 42), 'Orange3', 172)], (215, 135, 95): [((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173)], (215, 135, 135): [((215, 135, 135), (0, 50, 69), 'LightPink3', 174)], (215, 135, 175): [((215, 135, 175), (330, 50, 69), 'Pink3', 175)], (215, 135, 215): [((215, 135, 215), (300, 50, 69), 'Plum3', 176)], (215, 135, 255): [((215, 135, 255), (280, 100, 76), 'Violet', 177)], (215, 175, 0): [((215, 175, 0), (49, 100, 42), 'Gold3', 178)], (215, 175, 95): [((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179)], (215, 175, 135): [((215, 175, 135), (30, 50, 69), 'Tan', 180)], (215, 175, 175): [((215, 175, 175), (0, 33, 76), 'MistyRose3', 181)], (215, 175, 215): [((215, 175, 215), (300, 33, 76), 'Thistle3', 182)], (215, 175, 255): [((215, 175, 255), (270, 100, 84), 'Plum2', 183)], (215, 215, 0): [((215, 215, 0), (60, 100, 42), 'Yellow3', 184)], (215, 215, 95): [((215, 215, 95), (60, 60, 61), 'Khaki3', 185)], (215, 215, 135): [((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186)], (215, 215, 175): [((215, 215, 175), (60, 33, 76), 'LightYellow3', 187)], (215, 215, 215): [((215, 215, 215), (0, 0, 84), 'Grey84', 188)], (215, 215, 255): [((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189)], (215, 255, 0): [((215, 255, 0), (69, 100, 50), 'Yellow2', 190)], (215, 255, 95): [((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191)], (215, 255, 135): [((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192)], (215, 255, 175): [((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193)], (215, 255, 215): [((215, 255, 215), (120, 100, 92), 'Honeydew2', 194)], (215, 255, 255): [((215, 255, 255), (180, 100, 92), 'LightCyan1', 195)], (218, 218, 218): [((218, 218, 218), (0, 0, 85), 'Grey85', 253)], (228, 228, 228): [((228, 228, 228), (0, 0, 89), 'Grey89', 254)], (238, 238, 238): [((238, 238, 238), (0, 0, 93), 'Grey93', 255)], (255, 0, 0): [((255, 0, 0), (0, 100, 50), 'Red', 9), ((255, 0, 0), (0, 100, 50), 'Red1', 196)], (255, 0, 95): [((255, 0, 95), (338, 100, 50), 'DeepPink2', 197)], (255, 0, 135): [((255, 0, 135), (328, 100, 50), 'DeepPink1', 198)], (255, 0, 175): [((255, 0, 175), (319, 100, 50), 'DeepPink1', 199)], (255, 0, 215): [((255, 0, 215), (309, 100, 50), 'Magenta2', 200)], (255, 0, 255): [((255, 0, 255), (300, 100, 50), 'Fuchsia', 13), ((255, 0, 255), (300, 100, 50), 'Magenta1', 201)], (255, 95, 0): [((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202)], (255, 95, 95): [((255, 95, 95), (0, 100, 69), 'IndianRed1', 203)], (255, 95, 135): [((255, 95, 135), (345, 100, 69), 'IndianRed1', 204)], (255, 95, 175): [((255, 95, 175), (330, 100, 69), 'HotPink', 205)], (255, 95, 215): [((255, 95, 215), (315, 100, 69), 'HotPink', 206)], (255, 95, 255): [((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207)], (255, 135, 0): [((255, 135, 0), (32, 100, 50), 'DarkOrange', 208)], (255, 135, 95): [((255, 135, 95), (15, 100, 69), 'Salmon1', 209)], (255, 135, 135): [((255, 135, 135), (0, 100, 76), 'LightCoral', 210)], (255, 135, 175): [((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211)], (255, 135, 215): [((255, 135, 215), (320, 100, 76), 'Orchid2', 212)], (255, 135, 255): [((255, 135, 255), (300, 100, 76), 'Orchid1', 213)], (255, 175, 0): [((255, 175, 0), (41, 100, 50), 'Orange1', 214)], (255, 175, 95): [((255, 175, 95), (30, 100, 69), 'SandyBrown', 215)], (255, 175, 135): [((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216)], (255, 175, 175): [((255, 175, 175), (0, 100, 84), 'LightPink1', 217)], (255, 175, 215): [((255, 175, 215), (330, 100, 84), 'Pink1', 218)], (255, 175, 255): [((255, 175, 255), (300, 100, 84), 'Plum1', 219)], (255, 215, 0): [((255, 215, 0), (51, 100, 50), 'Gold1', 220)], (255, 215, 95): [((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221)], (255, 215, 135): [((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222)], (255, 215, 175): [((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223)], (255, 215, 215): [((255, 215, 215), (0, 100, 92), 'MistyRose1', 224)], (255, 215, 255): [((255, 215, 255), (300, 100, 92), 'Thistle1', 225)], (255, 255, 0): [((255, 255, 0), (60, 100, 50), 'Yellow', 11), ((255, 255, 0), (60, 100, 50), 'Yellow1', 226)], (255, 255, 95): [((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227)], (255, 255, 135): [((255, 255, 135), (60, 100, 76), 'Khaki1', 228)], (255, 255, 175): [((255, 255, 175), (60, 100, 84), 'Wheat1', 229)], (255, 255, 215): [((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230)], (255, 255, 255): [((255, 255, 255), (0, 0, 100), 'White', 15), ((255, 255, 255), (0, 0, 100), 'Grey100', 231)]}

Registered colors keyed by RGB.

by_xterm: ClassVar[dict[int, Color]] = {0: ((0, 0, 0), (0, 0, 0), 'Black', 0), 1: ((128, 0, 0), (0, 100, 25), 'Maroon', 1), 2: ((0, 128, 0), (120, 100, 25), 'Green', 2), 3: ((128, 128, 0), (60, 100, 25), 'Olive', 3), 4: ((0, 0, 128), (240, 100, 25), 'Navy', 4), 5: ((128, 0, 128), (300, 100, 25), 'Purple', 5), 6: ((0, 128, 128), (180, 100, 25), 'Teal', 6), 7: ((192, 192, 192), (0, 0, 75), 'Silver', 7), 8: ((128, 128, 128), (0, 0, 50), 'Grey', 8), 9: ((255, 0, 0), (0, 100, 50), 'Red', 9), 10: ((0, 255, 0), (120, 100, 50), 'Lime', 10), 11: ((255, 255, 0), (60, 100, 50), 'Yellow', 11), 12: ((0, 0, 255), (240, 100, 50), 'Blue', 12), 13: ((255, 0, 255), (300, 100, 50), 'Fuchsia', 13), 14: ((0, 255, 255), (180, 100, 50), 'Aqua', 14), 15: ((255, 255, 255), (0, 0, 100), 'White', 15), 16: ((0, 0, 0), (0, 0, 0), 'Grey0', 16), 17: ((0, 0, 95), (240, 100, 19), 'NavyBlue', 17), 18: ((0, 0, 135), (240, 100, 26), 'DarkBlue', 18), 19: ((0, 0, 175), (240, 100, 34), 'Blue3', 19), 20: ((0, 0, 215), (240, 100, 42), 'Blue3', 20), 21: ((0, 0, 255), (240, 100, 50), 'Blue1', 21), 22: ((0, 95, 0), (120, 100, 19), 'DarkGreen', 22), 23: ((0, 95, 95), (180, 100, 19), 'DeepSkyBlue4', 23), 24: ((0, 95, 135), (198, 100, 26), 'DeepSkyBlue4', 24), 25: ((0, 95, 175), (207, 100, 34), 'DeepSkyBlue4', 25), 26: ((0, 95, 215), (213, 100, 42), 'DodgerBlue3', 26), 27: ((0, 95, 255), (218, 100, 50), 'DodgerBlue2', 27), 28: ((0, 135, 0), (120, 100, 26), 'Green4', 28), 29: ((0, 135, 95), (162, 100, 26), 'SpringGreen4', 29), 30: ((0, 135, 135), (180, 100, 26), 'Turquoise4', 30), 31: ((0, 135, 175), (194, 100, 34), 'DeepSkyBlue3', 31), 32: ((0, 135, 215), (202, 100, 42), 'DeepSkyBlue3', 32), 33: ((0, 135, 255), (208, 100, 50), 'DodgerBlue1', 33), 34: ((0, 175, 0), (120, 100, 34), 'Green3', 34), 35: ((0, 175, 95), (153, 100, 34), 'SpringGreen3', 35), 36: ((0, 175, 135), (166, 100, 34), 'DarkCyan', 36), 37: ((0, 175, 175), (180, 100, 34), 'LightSeaGreen', 37), 38: ((0, 175, 215), (191, 100, 42), 'DeepSkyBlue2', 38), 39: ((0, 175, 255), (199, 100, 50), 'DeepSkyBlue1', 39), 40: ((0, 215, 0), (120, 100, 42), 'Green3', 40), 41: ((0, 215, 95), (147, 100, 42), 'SpringGreen3', 41), 42: ((0, 215, 135), (158, 100, 42), 'SpringGreen2', 42), 43: ((0, 215, 175), (169, 100, 42), 'Cyan3', 43), 44: ((0, 215, 215), (180, 100, 42), 'DarkTurquoise', 44), 45: ((0, 215, 255), (189, 100, 50), 'Turquoise2', 45), 46: ((0, 255, 0), (120, 100, 50), 'Green1', 46), 47: ((0, 255, 95), (142, 100, 50), 'SpringGreen2', 47), 48: ((0, 255, 135), (152, 100, 50), 'SpringGreen1', 48), 49: ((0, 255, 175), (161, 100, 50), 'MediumSpringGreen', 49), 50: ((0, 255, 215), (171, 100, 50), 'Cyan2', 50), 51: ((0, 255, 255), (180, 100, 50), 'Cyan1', 51), 52: ((95, 0, 0), (0, 100, 19), 'DarkRed', 52), 53: ((95, 0, 95), (300, 100, 19), 'DeepPink4', 53), 54: ((95, 0, 135), (282, 100, 26), 'Purple4', 54), 55: ((95, 0, 175), (273, 100, 34), 'Purple4', 55), 56: ((95, 0, 215), (267, 100, 42), 'Purple3', 56), 57: ((95, 0, 255), (262, 100, 50), 'BlueViolet', 57), 58: ((95, 95, 0), (60, 100, 19), 'Orange4', 58), 59: ((95, 95, 95), (0, 0, 37), 'Grey37', 59), 60: ((95, 95, 135), (240, 17, 45), 'MediumPurple4', 60), 61: ((95, 95, 175), (240, 33, 53), 'SlateBlue3', 61), 62: ((95, 95, 215), (240, 60, 61), 'SlateBlue3', 62), 63: ((95, 95, 255), (240, 100, 69), 'RoyalBlue1', 63), 64: ((95, 135, 0), (78, 100, 26), 'Chartreuse4', 64), 65: ((95, 135, 95), (120, 17, 45), 'DarkSeaGreen4', 65), 66: ((95, 135, 135), (180, 17, 45), 'PaleTurquoise4', 66), 67: ((95, 135, 175), (210, 33, 53), 'SteelBlue', 67), 68: ((95, 135, 215), (220, 60, 61), 'SteelBlue3', 68), 69: ((95, 135, 255), (225, 100, 69), 'CornflowerBlue', 69), 70: ((95, 175, 0), (87, 100, 34), 'Chartreuse3', 70), 71: ((95, 175, 95), (120, 33, 53), 'DarkSeaGreen4', 71), 72: ((95, 175, 135), (150, 33, 53), 'CadetBlue', 72), 73: ((95, 175, 175), (180, 33, 53), 'CadetBlue', 73), 74: ((95, 175, 215), (200, 60, 61), 'SkyBlue3', 74), 75: ((95, 175, 255), (210, 100, 69), 'SteelBlue1', 75), 76: ((95, 215, 0), (93, 100, 42), 'Chartreuse3', 76), 77: ((95, 215, 95), (120, 60, 61), 'PaleGreen3', 77), 78: ((95, 215, 135), (140, 60, 61), 'SeaGreen3', 78), 79: ((95, 215, 175), (160, 60, 61), 'Aquamarine3', 79), 80: ((95, 215, 215), (180, 60, 61), 'MediumTurquoise', 80), 81: ((95, 215, 255), (195, 100, 69), 'SteelBlue1', 81), 82: ((95, 255, 0), (98, 100, 50), 'Chartreuse2', 82), 83: ((95, 255, 95), (120, 100, 69), 'SeaGreen2', 83), 84: ((95, 255, 135), (135, 100, 69), 'SeaGreen1', 84), 85: ((95, 255, 175), (150, 100, 69), 'SeaGreen1', 85), 86: ((95, 255, 215), (165, 100, 69), 'Aquamarine1', 86), 87: ((95, 255, 255), (180, 100, 69), 'DarkSlateGray2', 87), 88: ((135, 0, 0), (0, 100, 26), 'DarkRed', 88), 89: ((135, 0, 95), (318, 100, 26), 'DeepPink4', 89), 90: ((135, 0, 135), (300, 100, 26), 'DarkMagenta', 90), 91: ((135, 0, 175), (286, 100, 34), 'DarkMagenta', 91), 92: ((135, 0, 215), (278, 100, 42), 'DarkViolet', 92), 93: ((135, 0, 255), (272, 100, 50), 'Purple', 93), 94: ((135, 95, 0), (42, 100, 26), 'Orange4', 94), 95: ((135, 95, 95), (0, 17, 45), 'LightPink4', 95), 96: ((135, 95, 135), (300, 17, 45), 'Plum4', 96), 97: ((135, 95, 175), (270, 33, 53), 'MediumPurple3', 97), 98: ((135, 95, 215), (260, 60, 61), 'MediumPurple3', 98), 99: ((135, 95, 255), (255, 100, 69), 'SlateBlue1', 99), 100: ((135, 135, 0), (60, 100, 26), 'Yellow4', 100), 101: ((135, 135, 95), (60, 17, 45), 'Wheat4', 101), 102: ((135, 135, 135), (0, 0, 53), 'Grey53', 102), 103: ((135, 135, 175), (240, 20, 61), 'LightSlateGrey', 103), 104: ((135, 135, 215), (240, 50, 69), 'MediumPurple', 104), 105: ((135, 135, 255), (240, 100, 76), 'LightSlateBlue', 105), 106: ((135, 175, 0), (74, 100, 34), 'Yellow4', 106), 107: ((135, 175, 95), (90, 33, 53), 'DarkOliveGreen3', 107), 108: ((135, 175, 135), (120, 20, 61), 'DarkSeaGreen', 108), 109: ((135, 175, 175), (180, 20, 61), 'LightSkyBlue3', 109), 110: ((135, 175, 215), (210, 50, 69), 'LightSkyBlue3', 110), 111: ((135, 175, 255), (220, 100, 76), 'SkyBlue2', 111), 112: ((135, 215, 0), (82, 100, 42), 'Chartreuse2', 112), 113: ((135, 215, 95), (100, 60, 61), 'DarkOliveGreen3', 113), 114: ((135, 215, 135), (120, 50, 69), 'PaleGreen3', 114), 115: ((135, 215, 175), (150, 50, 69), 'DarkSeaGreen3', 115), 116: ((135, 215, 215), (180, 50, 69), 'DarkSlateGray3', 116), 117: ((135, 215, 255), (200, 100, 76), 'SkyBlue1', 117), 118: ((135, 255, 0), (88, 100, 50), 'Chartreuse1', 118), 119: ((135, 255, 95), (105, 100, 69), 'LightGreen', 119), 120: ((135, 255, 135), (120, 100, 76), 'LightGreen', 120), 121: ((135, 255, 175), (140, 100, 76), 'PaleGreen1', 121), 122: ((135, 255, 215), (160, 100, 76), 'Aquamarine1', 122), 123: ((135, 255, 255), (180, 100, 76), 'DarkSlateGray1', 123), 124: ((175, 0, 0), (0, 100, 34), 'Red3', 124), 125: ((175, 0, 95), (327, 100, 34), 'DeepPink4', 125), 126: ((175, 0, 135), (314, 100, 34), 'MediumVioletRed', 126), 127: ((175, 0, 175), (300, 100, 34), 'Magenta3', 127), 128: ((175, 0, 215), (289, 100, 42), 'DarkViolet', 128), 129: ((175, 0, 255), (281, 100, 50), 'Purple', 129), 130: ((175, 95, 0), (33, 100, 34), 'DarkOrange3', 130), 131: ((175, 95, 95), (0, 33, 53), 'IndianRed', 131), 132: ((175, 95, 135), (330, 33, 53), 'HotPink3', 132), 133: ((175, 95, 175), (300, 33, 53), 'MediumOrchid3', 133), 134: ((175, 95, 215), (280, 60, 61), 'MediumOrchid', 134), 135: ((175, 95, 255), (270, 100, 69), 'MediumPurple2', 135), 136: ((175, 135, 0), (46, 100, 34), 'DarkGoldenrod', 136), 137: ((175, 135, 95), (30, 33, 53), 'LightSalmon3', 137), 138: ((175, 135, 135), (0, 20, 61), 'RosyBrown', 138), 139: ((175, 135, 175), (300, 20, 61), 'Grey63', 139), 140: ((175, 135, 215), (270, 50, 69), 'MediumPurple2', 140), 141: ((175, 135, 255), (260, 100, 76), 'MediumPurple1', 141), 142: ((175, 175, 0), (60, 100, 34), 'Gold3', 142), 143: ((175, 175, 95), (60, 33, 53), 'DarkKhaki', 143), 144: ((175, 175, 135), (60, 20, 61), 'NavajoWhite3', 144), 145: ((175, 175, 175), (0, 0, 69), 'Grey69', 145), 146: ((175, 175, 215), (240, 33, 76), 'LightSteelBlue3', 146), 147: ((175, 175, 255), (240, 100, 84), 'LightSteelBlue', 147), 148: ((175, 215, 0), (71, 100, 42), 'Yellow3', 148), 149: ((175, 215, 95), (80, 60, 61), 'DarkOliveGreen3', 149), 150: ((175, 215, 135), (90, 50, 69), 'DarkSeaGreen3', 150), 151: ((175, 215, 175), (120, 33, 76), 'DarkSeaGreen2', 151), 152: ((175, 215, 215), (180, 33, 76), 'LightCyan3', 152), 153: ((175, 215, 255), (210, 100, 84), 'LightSkyBlue1', 153), 154: ((175, 255, 0), (79, 100, 50), 'GreenYellow', 154), 155: ((175, 255, 95), (90, 100, 69), 'DarkOliveGreen2', 155), 156: ((175, 255, 135), (100, 100, 76), 'PaleGreen1', 156), 157: ((175, 255, 175), (120, 100, 84), 'DarkSeaGreen2', 157), 158: ((175, 255, 215), (150, 100, 84), 'DarkSeaGreen1', 158), 159: ((175, 255, 255), (180, 100, 84), 'PaleTurquoise1', 159), 160: ((215, 0, 0), (0, 100, 42), 'Red3', 160), 161: ((215, 0, 95), (333, 100, 42), 'DeepPink3', 161), 162: ((215, 0, 135), (322, 100, 42), 'DeepPink3', 162), 163: ((215, 0, 175), (311, 100, 42), 'Magenta3', 163), 164: ((215, 0, 215), (300, 100, 42), 'Magenta3', 164), 165: ((215, 0, 255), (291, 100, 50), 'Magenta2', 165), 166: ((215, 95, 0), (27, 100, 42), 'DarkOrange3', 166), 167: ((215, 95, 95), (0, 60, 61), 'IndianRed', 167), 168: ((215, 95, 135), (340, 60, 61), 'HotPink3', 168), 169: ((215, 95, 175), (320, 60, 61), 'HotPink2', 169), 170: ((215, 95, 215), (300, 60, 61), 'Orchid', 170), 171: ((215, 95, 255), (285, 100, 69), 'MediumOrchid1', 171), 172: ((215, 135, 0), (38, 100, 42), 'Orange3', 172), 173: ((215, 135, 95), (20, 60, 61), 'LightSalmon3', 173), 174: ((215, 135, 135), (0, 50, 69), 'LightPink3', 174), 175: ((215, 135, 175), (330, 50, 69), 'Pink3', 175), 176: ((215, 135, 215), (300, 50, 69), 'Plum3', 176), 177: ((215, 135, 255), (280, 100, 76), 'Violet', 177), 178: ((215, 175, 0), (49, 100, 42), 'Gold3', 178), 179: ((215, 175, 95), (40, 60, 61), 'LightGoldenrod3', 179), 180: ((215, 175, 135), (30, 50, 69), 'Tan', 180), 181: ((215, 175, 175), (0, 33, 76), 'MistyRose3', 181), 182: ((215, 175, 215), (300, 33, 76), 'Thistle3', 182), 183: ((215, 175, 255), (270, 100, 84), 'Plum2', 183), 184: ((215, 215, 0), (60, 100, 42), 'Yellow3', 184), 185: ((215, 215, 95), (60, 60, 61), 'Khaki3', 185), 186: ((215, 215, 135), (60, 50, 69), 'LightGoldenrod2', 186), 187: ((215, 215, 175), (60, 33, 76), 'LightYellow3', 187), 188: ((215, 215, 215), (0, 0, 84), 'Grey84', 188), 189: ((215, 215, 255), (240, 100, 92), 'LightSteelBlue1', 189), 190: ((215, 255, 0), (69, 100, 50), 'Yellow2', 190), 191: ((215, 255, 95), (75, 100, 69), 'DarkOliveGreen1', 191), 192: ((215, 255, 135), (80, 100, 76), 'DarkOliveGreen1', 192), 193: ((215, 255, 175), (90, 100, 84), 'DarkSeaGreen1', 193), 194: ((215, 255, 215), (120, 100, 92), 'Honeydew2', 194), 195: ((215, 255, 255), (180, 100, 92), 'LightCyan1', 195), 196: ((255, 0, 0), (0, 100, 50), 'Red1', 196), 197: ((255, 0, 95), (338, 100, 50), 'DeepPink2', 197), 198: ((255, 0, 135), (328, 100, 50), 'DeepPink1', 198), 199: ((255, 0, 175), (319, 100, 50), 'DeepPink1', 199), 200: ((255, 0, 215), (309, 100, 50), 'Magenta2', 200), 201: ((255, 0, 255), (300, 100, 50), 'Magenta1', 201), 202: ((255, 95, 0), (22, 100, 50), 'OrangeRed1', 202), 203: ((255, 95, 95), (0, 100, 69), 'IndianRed1', 203), 204: ((255, 95, 135), (345, 100, 69), 'IndianRed1', 204), 205: ((255, 95, 175), (330, 100, 69), 'HotPink', 205), 206: ((255, 95, 215), (315, 100, 69), 'HotPink', 206), 207: ((255, 95, 255), (300, 100, 69), 'MediumOrchid1', 207), 208: ((255, 135, 0), (32, 100, 50), 'DarkOrange', 208), 209: ((255, 135, 95), (15, 100, 69), 'Salmon1', 209), 210: ((255, 135, 135), (0, 100, 76), 'LightCoral', 210), 211: ((255, 135, 175), (340, 100, 76), 'PaleVioletRed1', 211), 212: ((255, 135, 215), (320, 100, 76), 'Orchid2', 212), 213: ((255, 135, 255), (300, 100, 76), 'Orchid1', 213), 214: ((255, 175, 0), (41, 100, 50), 'Orange1', 214), 215: ((255, 175, 95), (30, 100, 69), 'SandyBrown', 215), 216: ((255, 175, 135), (20, 100, 76), 'LightSalmon1', 216), 217: ((255, 175, 175), (0, 100, 84), 'LightPink1', 217), 218: ((255, 175, 215), (330, 100, 84), 'Pink1', 218), 219: ((255, 175, 255), (300, 100, 84), 'Plum1', 219), 220: ((255, 215, 0), (51, 100, 50), 'Gold1', 220), 221: ((255, 215, 95), (45, 100, 69), 'LightGoldenrod2', 221), 222: ((255, 215, 135), (40, 100, 76), 'LightGoldenrod2', 222), 223: ((255, 215, 175), (30, 100, 84), 'NavajoWhite1', 223), 224: ((255, 215, 215), (0, 100, 92), 'MistyRose1', 224), 225: ((255, 215, 255), (300, 100, 92), 'Thistle1', 225), 226: ((255, 255, 0), (60, 100, 50), 'Yellow1', 226), 227: ((255, 255, 95), (60, 100, 69), 'LightGoldenrod1', 227), 228: ((255, 255, 135), (60, 100, 76), 'Khaki1', 228), 229: ((255, 255, 175), (60, 100, 84), 'Wheat1', 229), 230: ((255, 255, 215), (60, 100, 92), 'Cornsilk1', 230), 231: ((255, 255, 255), (0, 0, 100), 'Grey100', 231), 232: ((8, 8, 8), (0, 0, 3), 'Grey3', 232), 233: ((18, 18, 18), (0, 0, 7), 'Grey7', 233), 234: ((28, 28, 28), (0, 0, 11), 'Grey11', 234), 235: ((38, 38, 38), (0, 0, 15), 'Grey15', 235), 236: ((48, 48, 48), (0, 0, 19), 'Grey19', 236), 237: ((58, 58, 58), (0, 0, 23), 'Grey23', 237), 238: ((68, 68, 68), (0, 0, 27), 'Grey27', 238), 239: ((78, 78, 78), (0, 0, 31), 'Grey30', 239), 240: ((88, 88, 88), (0, 0, 35), 'Grey35', 240), 241: ((98, 98, 98), (0, 0, 38), 'Grey39', 241), 242: ((108, 108, 108), (0, 0, 42), 'Grey42', 242), 243: ((118, 118, 118), (0, 0, 46), 'Grey46', 243), 244: ((128, 128, 128), (0, 0, 50), 'Grey50', 244), 245: ((138, 138, 138), (0, 0, 54), 'Grey54', 245), 246: ((148, 148, 148), (0, 0, 58), 'Grey58', 246), 247: ((158, 158, 158), (0, 0, 62), 'Grey62', 247), 248: ((168, 168, 168), (0, 0, 66), 'Grey66', 248), 249: ((178, 178, 178), (0, 0, 70), 'Grey70', 249), 250: ((188, 188, 188), (0, 0, 74), 'Grey74', 250), 251: ((198, 198, 198), (0, 0, 78), 'Grey78', 251), 252: ((208, 208, 208), (0, 0, 82), 'Grey82', 252), 253: ((218, 218, 218), (0, 0, 85), 'Grey85', 253), 254: ((228, 228, 228), (0, 0, 89), 'Grey89', 254), 255: ((238, 238, 238), (0, 0, 93), 'Grey93', 255)}

Registered colors keyed by xterm palette index, at most one color per index, later registrations overwrite earlier ones.

classmethod interpolate(color_a: Color, color_b: Color, step: float) Color[source]

Shorthand for color_a.interpolate(color_b, step).

Parameters:
  • color_a – The color at step=0.

  • color_b – The color at step=1.

  • step – Interpolation position between the two colors.

Returns:

The interpolated color.

classmethod register(rgb: RGB, hls: HSL | None = None, name: str | None = None, xterm: int | None = None) Color[source]

Create a Color, index it, and return it.

Parameters:
  • rgb – The color’s RGB representation.

  • hls – The color’s HSL representation, derived from rgb via HSL.from_rgb if omitted.

  • name – An optional human-readable name to index by (both as given and lowercased).

  • xterm – An optional xterm 256-color palette index to index by.

Returns:

The newly created and registered Color.

progressbar.terminal.base.DOWN: CSI = <progressbar.terminal.base.CSI object>

Cursor Down Ps Times (default = 1) (CUD)

class progressbar.terminal.base.DummyColor[source]

Bases: object

No-op color: renders text unstyled.

Used where a real styling callable is expected (Color.fg/ Color.bg/Color.underline) but the terminal can’t render this kind of styling, e.g. background/underline color on the legacy Windows console.

progressbar.terminal.base.ESC = '\x1b'

ANSI escape character (\x1b), the CSI/SGR sequence prefix.

progressbar.terminal.base.HIDE_CURSOR: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Cursor Visibility (DECTCEM)

class progressbar.terminal.base.HSL(hue: float, saturation: float, lightness: float)[source]

Bases: NamedTuple

Hue, Saturation, Lightness color.

Hue is a value between 0 and 360, saturation and lightness are between 0(%) and 100(%).

Create new instance of HSL(hue, saturation, lightness)

classmethod from_rgb(rgb: RGB) HSL[source]

Convert a 0-255 RGB color to an HSL color.

colorsys.rgb_to_hls returns HLS (hue, lightness, saturation) order, not HSL: its second element is lightness and its third is saturation. This reorders those into this class’s HSL fields (hls[2] -> saturation, hls[1] -> lightness).

Parameters:

rgb – The color to convert.

Returns:

The equivalent HSL color.

hue: float

Alias for field number 0

interpolate(end: HSL, step: float) HSL[source]

Linearly interpolate between this color and end.

Parameters:
  • end – The color to interpolate toward.

  • step – Interpolation position. 0 returns this color, 1 returns end. Not clamped to [0, 1].

Returns:

The interpolated color.

lightness: float

Alias for field number 2

saturation: float

Alias for field number 1

progressbar.terminal.base.LEFT: CSI = <progressbar.terminal.base.CSI object>

Cursor Backward Ps Times (default = 1) (CUB)

progressbar.terminal.base.NEXT_LINE: CSI = <progressbar.terminal.base.CSI object>

Cursor Next Line Ps Times (default = 1) (CNL) Same as Cursor Down Ps Times

progressbar.terminal.base.OptionalColor = progressbar.terminal.base.Color | progressbar.terminal.base.ColorGradient | None

A Color, a ColorGradient to resolve one from, or no color.

progressbar.terminal.base.PREVIOUS_LINE: CSI = <progressbar.terminal.base.CSI object>

Cursor Preceding Line Ps Times (default = 1) (CPL) Same as Cursor Up Ps Times

progressbar.terminal.base.RESTORE_CURSOR: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Restore Cursor Position (RCP)

class progressbar.terminal.base.RGB(red: int, green: int, blue: int)[source]

Bases: NamedTuple

Red, Green, Blue color, each channel 0-255.

Create new instance of RGB(red, green, blue)

blue: int

Blue channel, 0-255.

green: int

Green channel, 0-255.

property hex: str

The #rrggbb hex color string.

interpolate(end: RGB, step: float) RGB[source]

Linearly interpolate between this color and end.

Parameters:
  • end – The color to interpolate toward.

  • step – Interpolation position. 0 returns this color, 1 returns end. Not clamped to [0, 1] – a value outside that range extrapolates past whichever endpoint it’s beyond.

Returns:

The interpolated color, each channel computed independently and truncated (not rounded) to an int.

red: int

Red channel, 0-255.

property rgb: str

The rgb(r, g, b) CSS color string.

property to_ansi_16: int

Nearest ANSI 16-color-palette index (0-7) for this color.

Thresholds each channel at half intensity (>=128) into its bit of the 3-bit RGB code, rather than only lighting a channel at full intensity: an int(c / 255) threshold was only ever 1 at exactly 255, which collapsed almost every color (e.g. maroon 128,0,0) to black.

property to_ansi_256: int

Nearest xterm 256-color index (16-231, the 6x6x6 cube).

Rounds each channel to the nearest of 6 steps and combines them into the standard 16 + 36r + 6g + b cube index.

property to_windows: WindowsColors

Closest Windows 16-color-palette member for this color.

progressbar.terminal.base.RIGHT: CSI = <progressbar.terminal.base.CSI object>

Cursor Forward Ps Times (default = 1) (CUF)

progressbar.terminal.base.SAVE_CURSOR: CSINoArg = <progressbar.terminal.base.CSINoArg object>

Save Cursor Position (SCP)

progressbar.terminal.base.SCROLL_UP: CSI = <progressbar.terminal.base.CSI object>

Scroll up Ps lines (default = 1) (SU) Scroll down Ps lines (default = 1) (SD)

class progressbar.terminal.base.SGR(start_code: int, end_code: int)[source]

Bases: CSI

A paired start/end SGR (Select Graphic Rendition) style.

Wraps two SGR codes – one that turns a style on (start_code), one that turns it back off (end_code) – and calling the instance wraps text between them, e.g. bold('hi') -> '\x1b[1mhi\x1b[22m'.

Store the start/end SGR codes.

Parameters:
  • start_code – The SGR code that turns the style on.

  • end_code – The SGR code that turns the style back off.

class progressbar.terminal.base.SGRColor(color: Color, start_code: int, end_code: int)[source]

Bases: SGR

An SGR style parameterized by a Color.

Used for Color.fg/Color.bg/Color.underline: the start sequence carries both start_code and the color’s ansi parameter (e.g. '38;5;196'), rather than just a bare code.

Store the color and the start/end SGR codes.

Parameters:
  • color – The color to render.

  • start_code – The SGR code that turns the style on.

  • end_code – The SGR code that turns the style back off.

progressbar.terminal.base.UP: CSI = <progressbar.terminal.base.CSI object>

Cursor Up Ps Times (default = 1) (CUU)

class progressbar.terminal.base.WindowsColor(color: Color)[source]

Bases: object

Windows-compatible color wrapper for when ANSI is not supported.

Currently a no-op: real color output would require calling the Windows console API directly, but every caller expects a buffered string return instead (see the commented-out implementation in __call__), so this always returns text unchanged.

>>> WindowsColor(WindowsColors.RED)('test')
'test'

Wrap a Color for eventual Windows-console rendering.

Parameters:

color – The (already-resolved) color to wrap.

color
class progressbar.terminal.base.WindowsColors(*values)[source]

Bases: Enum

The 16 colors the legacy Windows console can render.

Named after the classic 16-color console palette (black through intense white). from_rgb maps an arbitrary RGB color to its nearest member for terminals without ANSI/truecolor support.

BLACK = (0, 0, 0)
BLUE = (0, 0, 128)
CYAN = (0, 128, 128)
GREEN = (0, 128, 0)
GREY = (192, 192, 192)
INTENSE_BLACK = (128, 128, 128)
INTENSE_BLUE = (0, 0, 255)
INTENSE_CYAN = (0, 255, 255)
INTENSE_GREEN = (0, 255, 0)
INTENSE_MAGENTA = (255, 0, 255)
INTENSE_RED = (255, 0, 0)
INTENSE_WHITE = (255, 255, 255)
INTENSE_YELLOW = (255, 255, 0)
MAGENTA = (128, 0, 128)
RED = (128, 0, 0)
YELLOW = (128, 128, 0)
static from_rgb(rgb: tuple[int, int, int]) WindowsColors[source]

Find the closest WindowsColors to the given RGB color.

Uses squared Euclidean distance in RGB space against all 16 palette members and returns the nearest.

Parameters:

rgb – The color to match, as an (r, g, b) tuple.

Returns:

The closest palette member.

>>> WindowsColors.from_rgb((0, 0, 0))
<WindowsColors.BLACK: (0, 0, 0)>
>>> WindowsColors.from_rgb((255, 255, 255))
<WindowsColors.INTENSE_WHITE: (255, 255, 255)>
>>> WindowsColors.from_rgb((0, 255, 0))
<WindowsColors.INTENSE_GREEN: (0, 255, 0)>
>>> WindowsColors.from_rgb((45, 45, 45))
<WindowsColors.BLACK: (0, 0, 0)>
>>> WindowsColors.from_rgb((128, 0, 128))
<WindowsColors.MAGENTA: (128, 0, 128)>
progressbar.terminal.base.apply_colors(text: str, percentage: float | None = None, *, fg: Color | ColorGradient | None = None, bg: Color | ColorGradient | None = None, fg_none: Color | None = None, bg_none: Color | None = None, **kwargs: Any) str[source]

Apply colors/gradients to a string depending on the given percentage.

When percentage is None, the fg_none and bg_none colors will be used. Otherwise, the fg and bg colors will be used. If the colors are gradients, the color will be interpolated depending on the percentage.

progressbar.terminal.base.bold: SGR = <progressbar.terminal.base.SGR object>

Bold (increased intensity) text (SGR 1/22).

progressbar.terminal.base.clear_line(n: int) str[source]

Clear the terminal line n rows above the cursor.

Moves the cursor up n lines, erases that line completely, then moves back down n lines, leaving the cursor position unchanged.

Parameters:

n – Number of lines above the cursor to clear.

Returns:

The combined escape sequence performing the move, clear, and move back.

progressbar.terminal.base.double_underline: SGR = <progressbar.terminal.base.SGR object>

Double-underlined text (SGR 21/24).

progressbar.terminal.base.encircled: SGR = <progressbar.terminal.base.SGR object>

Encircled text (SGR 52/54).

progressbar.terminal.base.faint: SGR = <progressbar.terminal.base.SGR object>

Faint (decreased intensity) text (SGR 2/22).

Fast-blinking text (SGR 6/25).

progressbar.terminal.base.framed: SGR = <progressbar.terminal.base.SGR object>

Framed text (SGR 51/54).

progressbar.terminal.base.get_color(value: float, color: Color | ColorGradient | None) Color | None[source]

Resolve color to a concrete Color for the given value.

If color is a ColorGradient, resolve it via ColorGradient.get_color. A plain Color (or None) passes through unchanged.

Parameters:
  • value – Position used to resolve a gradient, 0-1 (ignored for a plain Color).

  • color – The color or gradient to resolve.

Returns:

The resolved color, or None if color was None.

progressbar.terminal.base.gothic: SGR = <progressbar.terminal.base.SGR object>

Gothic/Fraktur text (SGR 20/10), rarely supported by terminals.

progressbar.terminal.base.inverse: SGR = <progressbar.terminal.base.SGR object>

Inverse/reverse video text, foreground and background swapped (SGR 7/27).

progressbar.terminal.base.italic: SGR = <progressbar.terminal.base.SGR object>

Italic text (SGR 3/23).

progressbar.terminal.base.overline: SGR = <progressbar.terminal.base.SGR object>

Overlined text (SGR 53/55).

Slow-blinking text (SGR 5/25).

progressbar.terminal.base.strike_through: SGR = <progressbar.terminal.base.SGR object>

Strikethrough text (SGR 9/29).

progressbar.terminal.base.underline: SGR = <progressbar.terminal.base.SGR object>

Underlined text (SGR 4/24).