-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcoloring.h
71 lines (59 loc) · 1.78 KB
/
coloring.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// VT Nibbler
// Copyright (c) 2024 James Holderness
// Distributed under the MIT License
#pragma once
#include <string>
class capabilities;
class options;
enum class color {
unknown = 0,
// Fixed colors
red = 1,
yellow = 3,
blue = 4,
cyan = 6,
white = 7,
snake = color::red,
// Components which change color
text = 2,
time = 5,
crouton_1 = 9,
crouton_2 = 13,
wall = 15,
// Monochrome attributes
mono_normal = 1,
mono_bright = 2,
mono_blinking = 3,
};
namespace palette {
static constexpr auto red = "72;0;0";
static constexpr auto orange = "100;72;0";
static constexpr auto green = "59;72;59";
static constexpr auto blue = "0;0;87";
static constexpr auto cyan = "0;72;59";
static constexpr auto purple = "72;0;87";
static constexpr auto gray = "72;72;59";
static constexpr auto bright_red = "100;0;0";
static constexpr auto bright_yellow = "100;100;0";
static constexpr auto bright_green = "0;100;0";
static constexpr auto bright_cyan = "0;59;87";
static constexpr auto bright_purple = "100;0;87";
static constexpr auto white = "100;100;87";
static constexpr auto white_blue = "81;81;90";
static constexpr auto red_purple = "84;25;41";
static constexpr auto red_orange = "84;38;25";
static constexpr auto green_blue = "58;65;74";
static constexpr auto purple_orange = "84;38;73";
static constexpr auto green_red = "38;81;25";
static constexpr auto blue_yellow = "43;43;73";
static constexpr auto cyan_red = "38;58;73";
} // namespace palette
class coloring {
public:
coloring(const capabilities& caps, const options& options);
~coloring();
private:
bool _using_colors;
std::string _color_assignment;
std::string _color_table;
};