Text color
foreground()
Sets text foreground color to rgb(0,0,0).
foreground(std::uint8_t rgandb)
Sets text foreground color to rgb(rgandb,rgandb,rgandb).
foreground(std::uint8_t r, std::uint8_t g, std::uint8_t b)
Sets text foreground color to rgb(r,g,b).
background()
Sets text background color to rgb(0,0,0).
background(std::uint8_t rgandb)
Sets text background color to rgb(rgandb,rgandb,rgandb).
background(std::uint8_t r, std::uint8_t g, std::uint8_t b)
Sets text background color to rgb(r,g,b).
inverse(bool offon = true)
Start (or stop) swapping last known foreground and background colors.
Reset all attributes
reset()
Resets all attributes to default.
foreground
and background
derive from struct rgb
.
#include <iostream> #include "wash_separately.h" int main() { wash_separately ws(std::cout); ws << "Hello, " << foreground(0,0,255) << "world" << reset() << "!\n"; return 0; }
Hello, world!