Skip to content

support string formatter's width specification #37

Open

Description

@keturn

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().

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions