diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2020-09-23 21:09:17 +0200 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2020-09-23 21:09:17 +0200 |
commit | 0dd5bbaf3ab1288adec3fdf6b25bc09fb98b5e15 (patch) | |
tree | db1a04c234062575c8f5f0a4aec8c6da53ff77d1 /src/character.c | |
parent | d51a86748a2826e5508451bfd3cc6fba14adc56f (diff) | |
download | AsciiMap-0dd5bbaf3ab1288adec3fdf6b25bc09fb98b5e15.tar.gz |
Diffstat (limited to 'src/character.c')
-rw-r--r-- | src/character.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/character.c b/src/character.c index 5aa2e92..b70cb1e 100644 --- a/src/character.c +++ b/src/character.c @@ -3,16 +3,14 @@ const char *default_character_map=" .,-~\"*:;<!/?%&=$#"; //const char *default_character_map=" `.,:;/+#@"; -char calc_char(uint8_t _c , uint8_t _min, uint8_t _max, char *_custom_map) -{ +char calc_char(uint8_t _c , uint8_t _min, uint8_t _max, char *_custom_map) { const char *map = _custom_map == 0 ? default_character_map : _custom_map; float c = (float)(_c) / (_max - _min); return map [(int)( strlen( map ) * (c))]; } -char* calc_col_ansi(uint8_t R, uint8_t G, uint8_t B, uint8_t _mode) -{ +char* calc_col_ansi(uint8_t R, uint8_t G, uint8_t B, uint8_t _mode) { int mode = _mode == COLOR_BG ? 4 : 3; int num = 36 * (R/51) + 6 * (G/51) + (B/51); char *c = malloc(12); |