commit f40a8fa44e7475a39c3d8c57699e8ba791aa9d73
Author: Raniconduh <clagv.randomgames@gmail.com>
Date: Thu Jan 12 10:26:11 2023 +0000
diff --git a/src/var.c b/src/var.c
index 2ff50ad..b360e82 100644
--- a/src/var.c
+++ b/src/var.c
@@ -57 +56 @@
#include <stdint.h>
#include <string.h>
#include <ctype.h>
-#include <math.h>
#include "hash.h"
#include "opts.h"
@@ -2915 +2814 @@ static uint32_t hextorgb(char * hex) {
uint16_t r, g, b;
uint32_t dec = 0;
- int cpow = strlen(p) - 1;
for (; *p; p++) {
char c = toupper(*p);
if (c >= 'A' && c <= 'F') c = htod[(int)c];
else if (c >= '0' && c <= '9') c -= '0';
else return COLOR_DEFAULT;
- dec += c * pow(16, cpow);
- cpow--;
+ dec *= 16;
+ dec += c;
}
// convert to 10 bit color over 8 bit color