Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
de37de91
Commit
de37de91
authored
Jul 03, 2019
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove deprecated color API
parent
df1a3a14
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
54 deletions
+3
-54
include/fmt/color.h
include/fmt/color.h
+3
-54
No files found.
include/fmt/color.h
View file @
de37de91
...
...
@@ -12,54 +12,6 @@
FMT_BEGIN_NAMESPACE
#ifdef FMT_DEPRECATED_COLORS
// color and (v)print_colored are deprecated.
enum
FMT_DEPRECATED
color
{
black
,
red
,
green
,
yellow
,
blue
,
magenta
,
cyan
,
white
};
FMT_DEPRECATED
FMT_API
void
vprint_colored
(
color
c
,
string_view
format
,
format_args
args
);
FMT_DEPRECATED
FMT_API
void
vprint_colored
(
color
c
,
wstring_view
format
,
wformat_args
args
);
template
<
typename
...
Args
>
FMT_DEPRECATED
inline
void
print_colored
(
color
c
,
string_view
format_str
,
const
Args
&
...
args
)
{
vprint_colored
(
c
,
format_str
,
make_format_args
(
args
...));
}
template
<
typename
...
Args
>
FMT_DEPRECATED
inline
void
print_colored
(
color
c
,
wstring_view
format_str
,
const
Args
&
...
args
)
{
vprint_colored
(
c
,
format_str
,
make_format_args
<
wformat_context
>
(
args
...));
}
FMT_DEPRECATED
inline
void
vprint_colored
(
color
c
,
string_view
format
,
format_args
args
)
{
char
escape
[]
=
"
\x1b
[30m"
;
escape
[
3
]
=
static_cast
<
char
>
(
'0'
+
c
);
std
::
fputs
(
escape
,
stdout
);
vprint
(
format
,
args
);
std
::
fputs
(
internal
::
data
::
RESET_COLOR
,
stdout
);
}
FMT_DEPRECATED
inline
void
vprint_colored
(
color
c
,
wstring_view
format
,
wformat_args
args
)
{
wchar_t
escape
[]
=
L"
\x1b
[30m"
;
escape
[
3
]
=
static_cast
<
wchar_t
>
(
'0'
+
c
);
std
::
fputws
(
escape
,
stdout
);
vprint
(
format
,
args
);
std
::
fputws
(
internal
::
data
::
WRESET_COLOR
,
stdout
);
}
#else
enum
class
color
:
uint32_t
{
alice_blue
=
0xF0F8FF
,
// rgb(240,248,255)
antique_white
=
0xFAEBD7
,
// rgb(250,235,215)
...
...
@@ -221,18 +173,17 @@ enum class terminal_color : uint8_t {
bright_magenta
,
bright_cyan
,
bright_white
};
// enum class terminal_color
};
enum
class
emphasis
:
uint8_t
{
bold
=
1
,
italic
=
1
<<
1
,
underline
=
1
<<
2
,
strikethrough
=
1
<<
3
};
// enum class emphasis
};
// rgb is a struct for red, green and blue colors.
// We use rgb as name because some editors will show it as color direct in the
// editor.
// Using the name "rgb" makes some editors show the color in a tooltip.
struct
rgb
{
FMT_CONSTEXPR
rgb
()
:
r
(
0
),
g
(
0
),
b
(
0
)
{}
FMT_CONSTEXPR
rgb
(
uint8_t
r_
,
uint8_t
g_
,
uint8_t
b_
)
:
r
(
r_
),
g
(
g_
),
b
(
b_
)
{}
...
...
@@ -629,8 +580,6 @@ inline std::basic_string<Char> format(const text_style& ts, const S& format_str,
{
internal
::
make_args_checked
(
format_str
,
args
...)});
}
#endif
FMT_END_NAMESPACE
#endif // FMT_COLOR_H_
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment