stackchan-display
Loading...
Searching...
No Matches
ColorPalette.h
1
#pragma once
2
#include <M5Unified.h>
3
4
#include <map>
5
#include <string>
6
7
namespace
stackchan::display
8
{
9
16
enum class
DrawingLocation :
unsigned
char
17
{
18
// Skin
19
kSkin = 0,
// required
20
// Eye
21
kPupil,
22
kEyelash,
23
kEyelid,
24
kIris1,
25
kIris2,
26
kIrisBackground,
// required
27
kEyeHighlight,
28
kSclera,
29
kScleraBackground,
30
// Eyebrow
31
kEyeBrow,
32
// Mouth
33
kMouthBackground,
34
kInnerMouse,
35
kTongue,
36
// Cheek
37
kCheek1,
38
kCheek2,
39
// Chat Balloon
40
kBalloonForeground,
41
kBalloonBackground
42
};
43
47
class
ColorPalette
48
{
49
private
:
50
std::map<DrawingLocation, uint16_t> palette_;
51
52
public
:
53
// TODO(meganetaaan): constructor with color settings
54
ColorPalette
();
55
~ColorPalette
() =
default
;
56
ColorPalette
(
const
ColorPalette
&other) =
default
;
57
ColorPalette
&operator=(
const
ColorPalette
&other) =
default
;
58
59
uint16_t get(DrawingLocation key)
const
;
60
void
set(DrawingLocation key, uint16_t value);
61
bool
contains(DrawingLocation key);
62
void
clear(
void
);
63
};
64
}
// namespace stackchan::display
65
66
// defines for backward compatibility
67
#define COLOR_PRIMARY stackchan::display::DrawingLocation::kIris1
68
#define COLOR_SECONDARY stackchan::display::DrawingLocation::kIrisBackground
69
#define COLOR_BACKGROUND stackchan::display::DrawingLocation::kSkin
70
#define COLOR_BALLOON_FOREGROUND stackchan::display::DrawingLocation::kBalloonForeground
71
#define COLOR_BALLOON_BACKGROUND stackchan::display::DrawingLocation::kBalloonBackground
stackchan::display::ColorPalette
Definition
ColorPalette.h:48
src
ColorPalette.h
Generated by
1.12.0