|
aest 0.1.0
Collection of C++ utility libraries
|
Formats a color as TYPE(ch1, ch2, ch3, alpha). More...
Public Member Functions | |
| constexpr auto | parse (std::format_parse_context &ctx) |
| Parse the spec that every channel is formatted with. | |
| auto | format (const Color &color, std::format_context &ctx) const |
Write the formatted color to the output of ctx. | |
Private Attributes | |
| std::formatter< float > | _channel |
| Formatter for each channel, set by a non-empty spec. | |
| bool | _useDefault = true |
| Whether the spec was empty, printing three decimals. | |
Formats a color as TYPE(ch1, ch2, ch3, alpha).
The format spec is a floating-point spec applied to every channel, so {:.1f} prints one decimal each; an empty spec prints three decimals.
| Color | The color type to format |
Definition at line 25 of file Format.cppm.
|
inline |
Write the formatted color to the output of ctx.
| [in] | color | The color to format |
| [in,out] | ctx | The format context to write to |
Definition at line 44 of file Format.cppm.
|
inlineconstexpr |
Parse the spec that every channel is formatted with.
| [in,out] | ctx | The parse context, positioned at the spec |
Definition at line 32 of file Format.cppm.
|
private |
Formatter for each channel, set by a non-empty spec.
Definition at line 67 of file Format.cppm.
|
private |
Whether the spec was empty, printing three decimals.
Definition at line 68 of file Format.cppm.