working on 250 color palet for cell

This commit is contained in:
2025-01-31 21:25:55 -08:00
parent 6935d05349
commit 3040b8ac5a
3 changed files with 118 additions and 6 deletions

View File

@@ -1,8 +1,10 @@
#ifndef TART_H
#define TART_H
#ifdef __cplusplus
extern "C" {
#endif
#include "../source/term.h"
// #========================================================================#
// | PreacherDHM:TART
@@ -18,7 +20,55 @@ extern "C" {
// | over each cell.
// #========================================================================#
#define NULL_CELL 0
#define NULL_CELL (struct tart_cell){0,0,0,0,0}
#define TART_OK 0
#define TART_STYLE_BOLD 1
#define TART_STYLE_DIM 2
#define TART_STYLE_UNDERLINE 4
#define TART_STYLE_BLINKING 5
#define TART_STYLE_INVERSE 7
#define TART_STYLE_HIDDEN 8
#define TART_STYLE_STRIKETHROUGH 9
#define TART_COLOR_BLACK_FOREGROUND 30
#define TART_COLOR_RED_FOREGROUND 31
#define TART_COLOR_GREEN_FOREGROUND 32
#define TART_COLOR_YELLOW_FOREGROUND 33
#define TART_COLOR_BLUE_FOREGROUND 34
#define TART_COLOR_MAGENTA_FOREGROUND 35
#define TART_COLOR_CYAN_FOREGROUND 36
#define TART_COLOR_WHITE_FOREGROUND 37
#define TART_COLOR_DEFAULT_FOREGROUND 39
#define TART_COLOR_BLACK_BACKGROUND 40
#define TART_COLOR_RED_BACKGROUND 41
#define TART_COLOR_GREEN_BACKGROUND 42
#define TART_COLOR_YELLOW_BACKGROUND 43
#define TART_COLOR_BLUE_BACKGROUND 44
#define TART_COLOR_MAGENTA_BACKGROUND 55
#define TART_COLOR_CYAN_BACKGROUND 46
#define TART_COLOR_WHITE_BACKGROUND 47
#define TART_COLOR_DEFAULT_BACKGROUND 49
#define TART_COLOR_BRIGHT_BLACK_FOREGROUND 90
#define TART_COLOR_BRIGHT_RED_FOREGROUND 91
#define TART_COLOR_BRIGHT_GREEN_FOREGROUND 92
#define TART_COLOR_BRIGHT_YELLOW_FOREGROUND 93
#define TART_COLOR_BRIGHT_BLUE_FOREGROUND 94
#define TART_COLOR_BRIGHT_MAGENTA_FOREGROUND 95
#define TART_COLOR_BRIGHT_CYAN_FOREGROUND 96
#define TART_COLOR_BRIGHT_WHITE_FOREGROUND 97
#define TART_COLOR_BRIGHT_BLACK_BACKGROUND 100
#define TART_COLOR_BRIGHT_RED_BACKGROUND 101
#define TART_COLOR_BRIGHT_GREEN_BACKGROUND 102
#define TART_COLOR_BRIGHT_YELLOW_BACKGROUND 103
#define TART_COLOR_BRIGHT_BLUE_BACKGROUND 104
#define TART_COLOR_BRIGHT_MAGENTA_BACKGROUND 105
#define TART_COLOR_BRIGHT_CYAN_BACKGROUND 106
#define TART_COLOR_BRIGHT_WHITE_BACKGROUND 107
typedef unsigned char tart_byte;
typedef unsigned short tart_id;
@@ -37,13 +87,23 @@ struct tart_rgb {
* Includeing the display character.
*
*/
#ifdef TART_RGB_COLORS
struct tart_cell {
struct tart_rgb foreground;
struct tart_rgb background;
tart_byte style;
char display;
char* compiled;
};
#else
struct tart_cell {
tart_byte foreground;
tart_byte background;
tart_byte style;
char display;
char* compiled;
};
#endif
/* Tart Buffer
*
@@ -81,7 +141,13 @@ struct tart_window {
struct tart_window tart_create_window();
struct tart_buffer tart_create_buffer(tart_id id, struct tart_vec2 size, struct tart_vec2 position);
#ifdef TART_RGB_COLORS
struct tart_cell tart_create_cell(char display, tart_byte style, struct tart_rgb foreground, struct tart_rgb background);
#else
struct tart_cell tart_create_cell(char display, tart_byte style, tart_byte foreground, tart_byte background);
#endif
tart_byte tart_add_buffer(struct tart_window*, struct tart_buffer);
tart_byte tart_set_buffer(struct tart_window*, struct tart_buffer, tart_byte);