Porytiles
Loading...
Searching...
No Matches
text_formatter.hpp File Reference
#include <cstdint>
#include <format>
#include <functional>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>
#include "porytiles/utilities/panic/panic.hpp"
Include dependency graph for text_formatter.hpp:

Go to the source code of this file.

Classes

struct  porytiles::RgbColor
 RGB color representation for extracting color components from Style values. More...
 
class  porytiles::Style
 Text styling class supporting formatting, foreground colors, and background colors. More...
 
class  porytiles::FormatParam
 A text parameter with associated styling for formatted output. More...
 
class  porytiles::TextFormatter
 Abstract base class for applying text styling with context-aware formatting. More...
 

Namespaces

namespace  porytiles
 

Typedefs

using porytiles::FormattedMessageBuilder = std::function< std::vector< std::string >(const TextFormatter &)>
 Function type for building formatted messages with TextFormatter access.
 

Enumerations

enum class  porytiles::PredefinedColor : std::uint8_t {
  porytiles::none , porytiles::black , porytiles::red , porytiles::green ,
  porytiles::yellow , porytiles::blue , porytiles::magenta , porytiles::cyan ,
  porytiles::white
}
 Predefined color options for text styling. More...
 

Functions

constexpr Style porytiles::rgb_fg_style (std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Creates a Style value with a custom RGB foreground color.
 
constexpr Style porytiles::rgb_bg_style (std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Creates a Style value with a custom RGB background color.
 
constexpr Style porytiles::rgb_style (std::uint8_t r, std::uint8_t g, std::uint8_t b)
 Creates a Style value with a custom RGB foreground color (backward compatibility alias).