Skip to main content

Module color

Module color 

Source
Expand description

Color and style types for character cells: Color (this module) and Style, a {fg, bg} pair of two Colors with no other relation to anything else in this crate.

Split into private submodules by concern, animate/backend/testing-style: ansi is the 16-color ANSI palette and the shared indexed/ANSI quantization machinery, convert is Color’s inherent methods (constants, RGB resolution, gem color-space conversions), named is Color’s string-name/hex constructors (from_named, from_hex), palette_oklab is the generated Oklab table ansi quantizes against, parse is Color’s Display/FromStr/serde impls, style is Style itself, and tint is Tint, sprite colour modulation.

Structs§

InvalidAnsiIndex
Error returned when a u8 value has no corresponding AnsiColor.
ParseColorError
Error returned when parsing a Color from a string fails.
Style
A style consisting of foreground and background color.

Enums§

AnsiColor
Standard 16-color ANSI palette.
Color
Represents a color in the terminal grid.
Quantize
The distance metric Color::to_indexed_with and Color::to_ansi_with use to find a palette entry’s nearest neighbour.
Tint
How a sprite’s own pixels are recoloured at draw time.