stc
Loading...
Searching...
No Matches
Static Public Member Functions | List of all members
stc::colour::_detail::Colouriser< Mode > Struct Template Reference

#include <Colour.hpp>

Static Public Member Functions

template<FourBitColour Colour, typename CharT >
static constexpr std::basic_ostream< CharT > & fourBit (std::basic_ostream< CharT > &stream)
 
template<uint8_t code, typename CharT >
static constexpr std::basic_ostream< CharT > & eightBit (std::basic_ostream< CharT > &stream)
 
template<uint8_t r, uint8_t g, uint8_t b, typename CharT >
static constexpr std::basic_ostream< CharT > & truecolour (std::basic_ostream< CharT > &stream)
 

Member Function Documentation

◆ eightBit()

template<int Mode>
template<uint8_t code, typename CharT >
static constexpr std::basic_ostream< CharT > & stc::colour::_detail::Colouriser< Mode >::eightBit ( std::basic_ostream< CharT > &  stream)
inlinestaticconstexpr

Note that unlike four bit colours, 8 bit colours use a full uint8_t (from 0 to 255), so the values themselves are not named in an enum.

See also
https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

◆ fourBit()

template<int Mode>
template<FourBitColour Colour, typename CharT >
static constexpr std::basic_ostream< CharT > & stc::colour::_detail::Colouriser< Mode >::fourBit ( std::basic_ostream< CharT > &  stream)
inlinestaticconstexpr

◆ truecolour()

template<int Mode>
template<uint8_t r, uint8_t g, uint8_t b, typename CharT >
static constexpr std::basic_ostream< CharT > & stc::colour::_detail::Colouriser< Mode >::truecolour ( std::basic_ostream< CharT > &  stream)
inlinestaticconstexpr

Takes three template arguments corresponding to the red, green, and blue respectively, and works identically to standard RGB colours.

Note that while the underlying ANSI guarantees the colour you provide is used, there's no guarantee it'll render visibly everywhere. Remember that some people use light mode or theme variants that may not work with the colour you've picked. You need to be extra aware of theming when using this function.

See also
https://en.wikipedia.org/wiki/ANSI_escape_code#24-bit

The documentation for this struct was generated from the following file: