cpp-terminal
1.0.0
Small C++ library for writing multiplatform terminal applications
Loading...
Searching...
No Matches
style.cpp
Go to the documentation of this file.
1
/*
2
* cpp-terminal
3
* C++ library for writing multi-platform terminal applications.
4
*
5
* SPDX-FileCopyrightText: 2019-2024 cpp-terminal
6
*
7
* SPDX-License-Identifier: MIT
8
*/
9
10
#include "
cpp-terminal/style.hpp
"
11
12
std::string
Term::style
(
const
Term::Style
& style)
13
{
14
//https://unix.stackexchange.com/questions/212933/background-color-whitespace-when-end-of-the-terminal-reached
15
std::string ret{
"\u001b["
+ std::to_string(
static_cast<
std::uint8_t
>
(
style
)) +
'm'
};
16
if
(
style
==
Term::Style::DefaultBackgroundColor
) { ret +=
"\u001b[K"
; }
17
return
ret;
18
}
Term::style
std::string style(const Term::Style &style)
Definition
style.cpp:12
Term::Style
Style
Definition
style.hpp:24
Term::Style::DefaultBackgroundColor
@ DefaultBackgroundColor
style.hpp
cpp-terminal
style.cpp
Generated by
1.11.0