-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhV_Colours565.h
More file actions
executable file
·79 lines (69 loc) · 2.49 KB
/
Copy pathhV_Colours565.h
File metadata and controls
executable file
·79 lines (69 loc) · 2.49 KB
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
72
73
74
75
76
77
78
79
///
/// @file hV_Colours565.h
/// @brief Class Library for 5-6-5 coded colours
///
/// @details Project Pervasive Displays Library Suite
/// @n Based on highView technology
///
/// @author Rei Vilo
/// @date 11 Jan 2021
/// @version 507
///
/// @copyright (c) Rei Vilo, 2010-2023
/// @copyright Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)
///
#include "Functions.h"
#ifndef hV_COLOURS_RELEASE
///
/// @brief Library release number
///
#define hV_COLOURS_RELEASE 507
///
/// @class hV_Colours565
/// @brief for 5-6-5 coded colours = 64K colours
/// @details red: 5 bits, green: 6 bits, blue: 5 bits
///
class hV_Colours565
{
public:
///
/// @brief Constructor
///
hV_Colours565();
///
/// @name Colours constants
/// @note Both syntaxes are valid
/// * myColours.black and
/// * hV_Colours565::black
/// with extern hV_Colours565 myColours; declared below
///
// Colours RGB=565 Red Green Blue
// 4321054321043210
/// @{
static const uint16_t black = 0b0000000000000000; ///< black
static const uint16_t white = 0b1111111111111111; ///< white
static const uint16_t red = 0b1111100000000000; ///< red
static const uint16_t green = 0b0000011111100000; ///< green
static const uint16_t blue = 0b0000000000011111; ///< blue
static const uint16_t yellow = 0b1111111111100000; ///< yellow
static const uint16_t cyan = 0b0000011111111111; ///< cyan
static const uint16_t orange = 0b1111101111100000; ///< orange
static const uint16_t magenta = 0b1111100000001111; ///< magenta
static const uint16_t violet = 0b1111100000011111; ///< violet
static const uint16_t grey = 0b0111101111101111; ///< grey
static const uint16_t darkGrey = 0b0011100111100111; ///< dark grey
static const uint16_t brown = 0b0111100000000000; ///< brown
/// American-English variants
static const uint16_t gray = 0b0111101111101111; ///< American-English variant for grey
static const uint16_t darkGray = 0b0011100111100111; ///< American-English variant for dark grey
// e-Paper specific colours
static const uint16_t darkRed = 0b0011100000000000; ///< dark red for BWR e-paper screens
static const uint16_t lightRed = 0b1111100011100011; ///< light red for BWR e-paper screens
/// @}
};
///
/// @brief Instantiated object
/// @details myColours
///
extern hV_Colours565 myColours;
#endif // hV_COLOURS_RELEASE