Fluxion::CLI::Style
Terminal styling.
Colour is decided once, here, from whether stdout is a terminal and whether
the user asked for it to be off. Every renderer then styles unconditionally
and gets plain text automatically when it is piped into a file, a pager, or
CI — which is what makes the output safe to parse without a --no-color
flag on every command.
Constants
A named palette rather than raw codes at the call sites, so the meaning of a colour is stated once and stays consistent across commands.
The conventional override for the opposite case: colour in a pipe.
https://no-color.org — set to anything, colour goes away.
Instance methods
Truncates to size columns, marking that something was cut.
Display width, ignoring the escape sequences styling added.
Column alignment has to measure what the user sees, not what is in the string, or every styled table drifts.