ref: 118adea928e25b13d9a0d294c8c3de908ba5dbd9
parent: d3d6cc88b2ccbe251436b60dd37af3915ee0c420
author: Ali Gholami Rudi <[email protected]>
date: Sun Feb 15 11:23:53 EST 2015
clr: map colour #fff to #ffffff
--- a/clr.c
+++ b/clr.c
@@ -38,7 +38,7 @@
for (i = 0; i < len; i++)
if (strchr(digs, tolower(s[i])))
n = n * 16 + (strchr(digs, tolower(s[i])) - digs);
- return len == 1 ? n << 4 : n;
+ return len == 1 ? n * 255 / 15 : n;
}
int clr_get(char *s)