clutchlog::fmt::fg_16M Struct Reference
Internal colors management in 256 and 16M colors modes.

Foreground in 256-colors mode. More...

`#include <clutchlog.h>`

Inheritance diagram for clutchlog::fmt::fg_16M:
[legend]
Collaboration diagram for clutchlog::fmt::fg_16M:
[legend]

## Detailed Description

Foreground in 256-colors mode.

Definition at line 634 of file clutchlog.h.

## Public Member Functions

| fg_16M ()
| Empty constructor: no color.
| fg_16M (short r, short g, short b)
| Numeric triplet constructor. More...
| fg_16M (const std::string &srgb)
| Hex triplet string constructor. More...
| fg_16M (const fg &)
| Conversion constructor from 16-colors mode. More...
Public Member Functions inherited from clutchlog::fmt::color_16M
| color_16M (ground t)
| Constructor. More...
| color_16M (ground t, short r, short g, short b)
| Numeric triplet constructor. More...
| color_16M (ground t, const std::string &srgb)
| Hex triplet string constructor. More...
bool | is_set () const
| Returns true if the underying representation encodes an existing color.
std::ostream & | print_on (std::ostream &os) const
| Print the color RGB triplet on the given stream.
Public Member Functions inherited from clutchlog::fmt::color
| color (ansi a, ground g)
| Constructor. More...

## Additional Inherited Members

Public Attributes inherited from clutchlog::fmt::color_16M
short | red
| The encoded RGB indices. More...
short | green
short | blue
Public Attributes inherited from clutchlog::fmt::color
ansi | mode
enum clutchlog::fmt::color::ground | type
| Type of color (foreground or background).
Public Types inherited from clutchlog::fmt::color
enum | ground { fore = 38, back = 48 }
| Codes for representing foreground or background.

## Constructor & Destructor Documentation

## fg_16M() [1/3]

clutchlog::fmt::fg_16M::fg_16M | ( | short | r,
|  | short | g,
|  | short | b
| ) |  |

inline

Numeric triplet constructor.

Parameters are expected to be in [0,255].

Parameters

  r | Red color component.
  g | Green color component.
  b | Blue color component.

Definition at line 646 of file clutchlog.h.

## fg_16M() [2/3]

clutchlog::fmt::fg_16M::fg_16M | ( | const std::string & | srgb | ) |

inline

Hex triplet string constructor.

Note
  If the given string is ill-formed, it will silently encode a "no color".

Parameters

  srgb | A "web color" hexadecimal triplet of two characters, starting with a leading number sign (e.g. "#0055ff").

Definition at line 654 of file clutchlog.h.

## fg_16M() [3/3]

clutchlog::fmt::fg_16M::fg_16M | ( | const fg & |  | ) |

inline

Conversion constructor from 16-colors mode.

Warning
  Only encodes "no color", whatever is passed.

Definition at line 659 of file clutchlog.h.

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

- clutchlog.h