aboutsummaryrefslogtreecommitdiff
path: root/src/color.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-07-12 13:22:25 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-07-12 13:22:25 +0200
commit251daaa806397817a2a5e1779a06222c09c99296 (patch)
treeefb8da25ee581a2e1ac7007e98863a1e395682bb /src/color.c
parenta954555f2e1d13a8ff55ac12a9c0e6e162a4d313 (diff)
downloadAsciiMap-251daaa806397817a2a5e1779a06222c09c99296.tar.gz
Added whitespace mode
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/color.c b/src/color.c
index d822d56..b4f4a40 100644
--- a/src/color.c
+++ b/src/color.c
@@ -72,3 +72,12 @@ char* calc_col_ansi(uint8_t R, uint8_t G, uint8_t B)
return c;
}
+char* calc_bg_col_ansi(uint8_t R, uint8_t G, uint8_t B)
+{
+ int num = 36 * (R/51) + 6 * (G/51) + (B/51);
+ char *c = malloc(9);
+ snprintf( c, 6, "48;5;" );
+ snprintf( c + 5, 4, "%i", num + 16 );
+
+ return c;
+}