This is a color-aware counterpart of
It works exactly like the original, but keeps the colors
in the substrings. The ANSI escape sequences are ignored when
calculating the positions within the string.
ansi_substr(x, start, stop)
Character vector, potentially ANSI styled, or a vector to coarced to character.
Starting index or indices, recycled to match the length
Ending index or indices, recycled to match the length
Character vector of the same length as
the requested substrings. ANSI styles are retained.