colorful icon indicating copy to clipboard operation
colorful copied to clipboard

support string formatter's width specification

Open keturn opened this issue 6 years ago • 0 comments

Consider

print(f"A{cf.italic_underlined_lavender('Z'):>80}")

The Z ends up in quite a different spot when color output is enabled vs disabled!

I believe that since ColorfulString already knows how to calculate its printable length, it would be able to appropriately handle field width specifications if it were to implement __format__.

That method is used by both the f-string literals and format().

keturn avatar Dec 15 '19 12:12 keturn