aboutsummaryrefslogtreecommitdiff
path: root/src/color.c
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2020-08-29 14:47:57 +0200
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2020-08-29 14:47:57 +0200
commit4a395cae20c9cd0dcb8437390cf5e470e3c1720b (patch)
tree49d0cb0346db49cacafd3aec7337cecf5f5f0bcc /src/color.c
parent567e0df2434b270411d3356b8e362fc881113335 (diff)
downloadAsciiMap-4a395cae20c9cd0dcb8437390cf5e470e3c1720b.tar.gz
remove unneded
Diffstat (limited to 'src/color.c')
-rw-r--r--src/color.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/color.c b/src/color.c
index d7b3cdf..10afeea 100644
--- a/src/color.c
+++ b/src/color.c
@@ -28,42 +28,6 @@ uint8_t rgb_luminance(uint8_t R, uint8_t G, uint8_t B)
return ret;
}
-char* calc_col(uint8_t R, uint8_t G, uint8_t B)
-{
- unsigned int nearest_num = 0;
- uint8_t a2[3];
- a2[0] = colors[0].R;
- a2[1] = colors[0].G;
- a2[2] = colors[0].B;
-
- uint8_t a1[] = {R,G,B};
-
- //Normalize the color
- //Does not really work all that well
- /*while(a1[0] < 255 && a1[1] < 255 && a1[2] < 255)
- {
- a1[0]++;
- a1[1]++;
- a1[2]++;
- }*/
-
- float nearest_val = distance( a1, a2 );
-
- for( unsigned int i = 1; i < _COLORS_SIZE; i++)
- {
- a2[0] = colors[i].R;
- a2[1] = colors[i].G;
- a2[2] = colors[i].B;
-
- float dist = distance(a1, a2);
- if(dist < nearest_val){
- nearest_num = i;
- nearest_val = dist;
- }
- }
- return colors[ nearest_num ].no;
-}
-//TODO consolidate
char* calc_col_ansi(uint8_t R, uint8_t G, uint8_t B, uint8_t _mode)
{
int mode = _mode == COLOR_BG ? 4 : 3;
@@ -74,12 +38,3 @@ char* calc_col_ansi(uint8_t R, uint8_t G, uint8_t B, uint8_t _mode)
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;
-}