Color class

An immutable terminal colour: either a named ANSI colour or a 256-palette index. Use Color.ansi for theme-honouring named colours and Color.indexed for a fixed palette entry.

Constructors

Color.ansi(int code, {bool bright = false})
A named ANSI colour (0–7), rendered bright when used with Style.bold or via the 90–97 range when bright is set.
const
Color.indexed(int index)
A fixed 256-colour palette index (0–255).
const

Properties

hashCode int
The hash code for this object.
no setteroverride
isIndexed bool
Whether this is a 256-palette colour (vs. a named ANSI colour).
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Constants

black → const Color
blue → const Color
brightBlack → const Color
brightBlue → const Color
brightCyan → const Color
brightGreen → const Color
brightMagenta → const Color
brightRed → const Color
brightWhite → const Color
brightYellow → const Color
cyan → const Color
green → const Color
magenta → const Color
red → const Color
white → const Color
yellow → const Color