Expand description
Flags to control if any styling should occur
There are three levels, in order of precedence
- feature flags - compile time (
strip-colors
) - global - runtime
set_coloring_mode
,set_coloring_mode_from_env
- per value - runtime
StyledValue::stream
higher precedence options forces coloring or no-coloring even if lower precedence options specify otherwise.
For example, using StyledValue::stream
to Stream::AlwaysColor
doesn’t gurantee
that any coloring will happen. For example, if the strip-colors
feature flag is set
or if set(Mode::Never)
was called before.
However, these flags only control coloring on StyledValue
, so using
the color types directly to color values will always be supported (even with strip-colors
).
Structs
- An error if deserializing a mode from a string fails
- An error if deserializing a mode from a string fails
Enums
- The coloring kinds
- The coloring mode
- The stream to detect when to color on
Functions
- Get the global coloring mode
- Get the default stream
- Set the global coloring mode (this allows forcing colors on or off despite stream preferences)
- Reads the current mode from the environment
- Set the default stream if one isn’t chosen per value