BasicColor class
A color specified as a hex string or ANSI string code.
Supports:
- Hex colors:
#ff0000,#f00,ff0000 - ANSI string codes:
196,21
final red = BasicColor('#ff0000');
final blue = BasicColor('21');
Constructors
- BasicColor(String value)
-
Creates a color from a hex string or ANSI code string.
const
Properties
- dim → Color
-
Returns a dimmed version of this color (if applicable).
no setteroverride
- hashCode → int
-
The hash code for this object.
no setteroverride
- isHex → bool
-
Whether this is a hex color.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value → String
-
The color value (hex string or ANSI code).
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toAnsi(
ColorProfile profile, {bool background = false, bool underline = false, bool hasDarkBackground = true}) → String -
Produces the ANSI escape sequence for this color.
override
-
toHex(
) → String -
Returns the hex representation of this color.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override