libzypp 17.37.17
|
Traits class to enable custom Color construction. More...
#include <zypp-tui/utils/ansi.h>
Traits class to enable custom Color construction.
This enables using user types (usaually enums) to be used as Color with ColorString or ColorStream classes:
You need to define a function ansi::Color customColorCtor( EnumType enum_r ) which associates enum value and Color:
Then specailize ColorTraits for your enum to enable using it as ColorStream
This will enable your enum being impicitly converted into ansi::Color, especially when used together with ColorString and ColorStream. Printing your enum on a stream, will also print the associated colors SGR sequence: