An fansi.Str's color
s array is filled with Ints, each representing
the ANSI state of one character encoded in its bits.
An fansi.Str's color
s array is filled with Ints, each representing
the ANSI state of one character encoded in its bits. Each Attr belongs
to a Category that occupies a range of bits within each int:
31... 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 |--------| |-----------------------| |-----------------------| | | |bold | | | | |reversed | | | |underlined | | |foreground-color | |background-color |unused
The 0000 0000 0000 0000
int corresponds to plain text with no decoration
Creates an fansi.Str from a non-fansi java.lang.String
or other
CharSequence
.
Creates an fansi.Str from a non-fansi java.lang.String
or other
CharSequence
.
Note that this method is implicit, meaning you can pass in a
java.lang.String
anywhere an fansi.Str
is required and it will be
automatically parsed and converted for you.
throw an exception if an unrecognized fansi sequence exists. Off by default
Constructs a fansi.Str from an array of characters and an array of colors.
Constructs a fansi.Str from an array of characters and an array of colors. Performs a defensive copy of the arrays, and validates that they both have the same length
Useful together with getChars
and getColors
if you want to do manual
work on the two mutable arrays before stitching them back together into
one immutable fansi.Str
Make the construction of fansi.Strs from String
s and other
CharSequence
s automatic