LumaOS  v0.1.116
An experimental x86-64 OS
Loading...
Searching...
No Matches
color.h
Go to the documentation of this file.
1
9#ifndef KERNEL_LIB_COLOR_H
10#define KERNEL_LIB_COLOR_H
11
12#include <stdint.h>
13
15struct rgb {
16 uint8_t r;
17 uint8_t g;
18 uint8_t b;
19};
20
21// COLORS
22#define COLOR_BLACK get_rgb(0, 0, 0)
23#define COLOR_BLACK_BRIGHT get_rgb(128, 128, 128)
24
25#define COLOR_RED get_rgb(160, 0, 0)
26#define COLOR_RED_BRIGHT get_rgb(255, 50, 50)
27
28#define COLOR_GREEN get_rgb(0, 160, 0)
29#define COLOR_GREEN_BRIGHT get_rgb(50, 255, 50)
30
31#define COLOR_YELLOW get_rgb(160, 160, 0)
32#define COLOR_YELLOW_BRIGHT get_rgb(255, 255, 50)
33
34#define COLOR_BLUE get_rgb(0, 0, 200)
35#define COLOR_BLUE_BRIGHT get_rgb(60, 60, 255)
36
37#define COLOR_MAGENTA get_rgb(160, 0, 160)
38#define COLOR_MAGENTA_BRIGHT get_rgb(255, 50, 255)
39
40#define COLOR_CYAN get_rgb(0, 160, 160)
41#define COLOR_CYAN_BRIGHT get_rgb(50, 255, 255)
42
43#define COLOR_WHITE get_rgb(235, 235, 235)
44#define COLOR_WHITE_BRIGHT get_rgb(255, 255, 255)
45
46
47#define RGB(r,g,b) get_rgb(r,g,b)
48
56struct rgb get_rgb(uint8_t r, uint8_t g, uint8_t b);
57
64struct rgb add_rgb(struct rgb a, struct rgb b);
65
72struct rgb sub_rgb(struct rgb a, struct rgb b);
73
74
75#endif
struct rgb add_rgb(struct rgb a, struct rgb b)
Adds two RGB color values.
Definition color.c:22
struct rgb get_rgb(uint8_t r, uint8_t g, uint8_t b)
Creates an RGB color value from the 3 separate colors.
Definition color.c:12
struct rgb sub_rgb(struct rgb a, struct rgb b)
Subtracts the second RGB color from the first.
Definition color.c:32
RGB color values.
Definition color.h:15