AsciiColourRgb class
A 24-bit colour — any of the sixteen million, named by its channels rather than by a slot in a table.
print('deep sea'.foreground(const AsciiColourRgb(0x33, 0x66, 0x99)));
print('deep sea'.foreground(const AsciiColourRgb.hex(0x336699)));
Terminals that only know the 256-colour table either approximate this to the nearest entry or ignore it. AsciiColour is the safer choice where that matters.
Constructors
- AsciiColourRgb(int red, int green, int blue)
-
A colour from its three channels, each
0-255.const - AsciiColourRgb.hex(int value)
-
A colour from one
0xRRGGBBnumber, the way CSS writes it.const
Properties
- bg → String
-
Paints the background behind the text. Cleared by RESET_BG or by
reset.
no setterinherited
- blue → int
-
Blue channel,
0-255.final - fg → String
-
Paints the text this colour. Cleared by RESET_FG or by reset.
no setterinherited
- green → int
-
Green channel,
0-255.final - hashCode → int
-
The hash code for this object.
no setteroverride
- parameters → String
-
The colour half of the code, between the
38/48/58and them.no setteroverride - red → int
-
Red channel,
0-255.final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- underline → String
-
Paints the underline this colour, leaving the text its own colour.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
opacity(
double amount, {AsciiInk over = const AsciiColourRgb(0, 0, 0)}) → AsciiColourRgb -
This colour at
amountstrength overover— the fade ANSI has no code for, worked out in advance.inherited -
toRgb(
) → AsciiColourRgb -
This colour as three channels, so two of them can be mixed.
override
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override