# clutchlog: clutchlog::fmt::color Struct Reference

clutchlog::fmt::color Struct Referenceabstract
Internal colors management in 256 and 16M colors modes.

Interface class for colors representation. More...

`#include <clutchlog.h>`

Inheritance diagram for clutchlog::fmt::color:
[legend]

## Detailed Description

Interface class for colors representation.

Definition at line 484 of file clutchlog.h.

## Public Member Functions

| color (ansi a, ground g)
| Constructor. More...
virtual bool | is_set () const =0
| Should return true if the underying representation encodes an existing color. More...
virtual std::ostream & | print_on (std::ostream &os) const =0
| Should print the underlying representation on the given stream. More...

## Public Attributes

ansi | mode
enum clutchlog::fmt::color::ground | type
| Type of color (foreground or background).

## Public Types

enum class | ground { fore = 38 , back = 48 }
| Codes for representing foreground or background. More...

## Friends

std::ostream & | operator<< (std::ostream &os, const color &c)
| Print the actually encoded escaped color sequence on the given stream. More...

## Constructor & Destructor Documentation

## color()

clutchlog::fmt::color::color | ( | ansi | a,
|  | ground | g
| ) |  |

inline

Constructor.

Parameters

  a | ANSI mode (i.e. number of colors).
  g | Color type (i.e. foreground or background).

Definition at line 498 of file clutchlog.h.

## Member Function Documentation

## is_set()

virtual bool clutchlog::fmt::color::is_set | ( |  | ) | const

pure virtual

Should return true if the underying representation encodes an existing color.

Implemented in clutchlog::fmt::color_256, and clutchlog::fmt::color_16M.

## print_on()

virtual std::ostream & clutchlog::fmt::color::print_on | ( | std::ostream & | os | ) | const

pure virtual

Should print the underlying representation on the given stream.

Implemented in clutchlog::fmt::color_256, and clutchlog::fmt::color_16M.

## Friends And Related Function Documentation

## operator<<

std::ostream & operator<< | ( | std::ostream & | os,
|  | const color & | c
| ) |  |

friend

Print the actually encoded escaped color sequence on the given stream.

Definition at line 507 of file clutchlog.h.

## Member Data Documentation

## mode

ansi clutchlog::fmt::color::mode

Definition at line 485 of file clutchlog.h.

## Member Enumeration Documentation

## ground

enum class clutchlog::fmt::color::ground

strong

Codes for representing foreground or background.

Definition at line 488 of file clutchlog.h.

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

- clutchlog.h