summaryrefslogtreecommitdiff
path: root/defs/colors.h
blob: 0c376db2bbbf9603ef136da8f739e267a06234eb (plain)
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
#ifndef COLORS_H
#define COLORS_H

#include <stdlib.h>
#include <stdbool.h>

typedef enum color_mode {
    MODE_NONE, 
    MODE_ANSI16, 
    MODE_ANSI256, 
    MODE_TRUECOLOR 
}color_mode;

typedef enum NamedColor {
    Black,
    Red,
    Green,
    Yellow,
    Blue,
    Magenta,
    Cyan,
    White,
    BrightBlack,
    BrightRed,
    BrightGreen,
    BrightYellow,
    BrightBlue,
    BrightMagenta,
    BrightCyan,
    BrightWhite,
}NamedColor;

typedef struct{
    int red;
    int green;
    int blue;
}rgbcolor;

typedef struct colorconfig {
    enum color_mode mode;
    bool has_solid_color; 
    rgbcolor solid_color;
    bool rainbow_enabled;     //flag
    int saturation;          //default 100
    int brightness;          //default 50
    char **rainbow_cache;       //array of rgb_color malloced
    size_t rainbow_count;
}colorconfig;

#endif