3#include "terminalpp/graphics.hpp" 
    5#include <boost/container_hash/hash.hpp> 
   29        terminalpp::graphics::colour 
colour) noexcept
 
 
   40            static_cast<std::underlying_type_t<decltype(col.value_)
>>(
 
 
   51    terminalpp::graphics::colour value_;
 
 
   59std::ostream &operator<<(std::ostream &out, 
low_colour const &col);
 
   79    constexpr high_colour(
byte red, 
byte green, 
byte blue) noexcept
 
   80      : value_(ansi::graphics::encode_high_components(red, green, blue))
 
 
   90        boost::hash_combine(seed, col.value_);
 
 
 
  108std::ostream &operator<<(std::ostream &out, 
high_colour const &col);
 
  129      : shade_(ansi::graphics::encode_greyscale_component(shade))
 
 
  139        std::size_t seed = 0;
 
  140        boost::hash_combine(seed, col.shade_);
 
 
 
  179        byte const red, 
byte const green, 
byte const blue) 
noexcept   
  180      : red_(red), green_(green), blue_(blue)
 
 
  189        std::size_t seed = 0;
 
  190        boost::hash_combine(seed, col.red_);
 
  191        boost::hash_combine(seed, col.green_);
 
  192        boost::hash_combine(seed, col.blue_);
 
 
 
  212std::ostream &operator<<(std::ostream &out, 
true_colour const &col);
 
  230      : value_{std::move(col)}
 
 
  237    constexpr colour(terminalpp::graphics::colour col) 
noexcept   
 
  272            [](
auto const &val) { 
return hash_value(val); }, col.value_);
 
 
  279        colour const &lhs, 
colour const &rhs) 
noexcept = 
default;
 
  281    std::variant<low_colour, high_colour, greyscale_colour, true_colour> value_;
 
 
  289std::ostream &operator<<(std::ostream &out, 
colour const &col);
 
  296struct hash<terminalpp::low_colour>
 
  299    using result_type = std::size_t;
 
  301    [[nodiscard]] result_type operator()(
 
  304        return hash_value(col);
 
 
  309struct hash<terminalpp::high_colour>
 
  312    using result_type = std::size_t;
 
  314    [[nodiscard]] result_type operator()(
 
  317        return hash_value(col);
 
 
  322struct hash<terminalpp::greyscale_colour>
 
  325    using result_type = std::size_t;
 
  327    [[nodiscard]] result_type operator()(
 
  330        return hash_value(col);
 
 
  335struct hash<terminalpp::true_colour>
 
  338    using result_type = std::size_t;
 
  340    [[nodiscard]] result_type operator()(
 
  343        return hash_value(col);
 
 
  348struct hash<terminalpp::colour>
 
  351    using result_type = std::size_t;
 
  353    [[nodiscard]] result_type operator()(
 
  356        return hash_value(col);
 
 
Structure representing a sum type of the available colour styles.
Definition colour.hpp:218
 
constexpr colour(terminalpp::low_colour col) noexcept
Constructs a colour with the passed low_colour value.
Definition colour.hpp:229
 
constexpr friend auto operator<=>(colour const &lhs, colour const &rhs) noexcept=default
Comparison operators for colours.
 
constexpr colour(terminalpp::graphics::colour col) noexcept
Constructs a colour from an ANSI graphics low colour.
Definition colour.hpp:237
 
constexpr colour(terminalpp::greyscale_colour col) noexcept
Constructs a colour with the passed greyscale_colour value.
Definition colour.hpp:253
 
constexpr colour() noexcept
Default constructs the colour with the "default" ANSI colour.
Definition colour.hpp:222
 
constexpr colour(terminalpp::high_colour col) noexcept
Constructs a colour with the passed high_colour value.
Definition colour.hpp:245
 
friend std::size_t hash_value(colour const &col) noexcept
Hash function.
Definition colour.hpp:269
 
constexpr colour(terminalpp::true_colour col) noexcept
Constructs a colour with the passed true_colour value.
Definition colour.hpp:261
 
Structure representing the 24 greyscale tones of a 256-colour palette.
Definition colour.hpp:115
 
constexpr greyscale_colour(byte shade) noexcept
Constructs a greyscale value from the given shade, which should be in the range 0-23.
Definition colour.hpp:128
 
constexpr friend auto operator<=>(greyscale_colour const &lhs, greyscale_colour const &rhs) noexcept=default
Comparison operators for greyscale colours.
 
constexpr greyscale_colour() noexcept
Default constructs a greyscale value with the darkest available grey.
Definition colour.hpp:120
 
friend std::size_t hash_value(greyscale_colour const &col) noexcept
Hash function.
Definition colour.hpp:136
 
Structure representing the central 216 colours of a 256-colour palette, where each colour channel is ...
Definition colour.hpp:67
 
constexpr high_colour() noexcept
Default constructs a high-colour with the value of pure black.
Definition colour.hpp:71
 
constexpr high_colour(byte red, byte green, byte blue) noexcept
Constructs a high_colour from the passed-in RGB values, each of which should be in the range 0-5.
Definition colour.hpp:79
 
friend std::size_t hash_value(high_colour const &col) noexcept
Hash function.
Definition colour.hpp:87
 
constexpr friend auto operator<=>(high_colour const &lhs, high_colour const &rhs) noexcept=default
Comparison operators for high colours.
 
Structure representing a normal ANSI 16-colour value.
Definition colour.hpp:16
 
constexpr low_colour() noexcept
Constructs a low_colour with the "default" colour value.
Definition colour.hpp:20
 
constexpr low_colour(terminalpp::graphics::colour colour) noexcept
Constructs a low_colour from the passed-in ANSI colour.
Definition colour.hpp:28
 
constexpr friend auto operator<=>(low_colour const &lhs, low_colour const &rhs) noexcept=default
Comparison operators for low colours.
 
friend std::size_t hash_value(low_colour const &col) noexcept
Hash function.
Definition colour.hpp:35
 
Structure representing the ~16 million colours codes of the true colour palette.
Definition colour.hpp:166
 
constexpr true_colour(byte const red, byte const green, byte const blue) noexcept
Constructor.
Definition colour.hpp:178
 
friend std::size_t hash_value(true_colour const &col) noexcept
Hash function.
Definition colour.hpp:187
 
constexpr true_colour() noexcept
Default constructor constructs a true colour value that represents black.
Definition colour.hpp:171
 
constexpr friend auto operator<=>(true_colour const &lhs, true_colour const &rhs) noexcept=default
Comparison operators for true colours.