|
|
|
@ -6,19 +6,6 @@
@@ -6,19 +6,6 @@
|
|
|
|
|
#define ASCII_ZERO 48 |
|
|
|
|
#define ASCII_NINE 57 |
|
|
|
|
#define MIN_CONTRAST 0.5 |
|
|
|
|
//html = _dec_colors.sub(lambda match: _dec_spans[int(match.group(1))], qstr)
|
|
|
|
|
// this is an extremely fancy if not confusing way to say
|
|
|
|
|
// the single number that isn't an x, right after a ^
|
|
|
|
|
// is an index to an array of strings.
|
|
|
|
|
//html = _hex_colors.sub(hex_repl, html)
|
|
|
|
|
// the next 3 letters after after ^x is digits for rgb
|
|
|
|
|
// the verdict is:
|
|
|
|
|
// regex is not needed
|
|
|
|
|
// do the hex replacement first, then do the dec replacement
|
|
|
|
|
|
|
|
|
|
// instead of concatenating strings, they will be printed in parts.
|
|
|
|
|
|
|
|
|
|
// can either be RGB or HLS
|
|
|
|
|
|
|
|
|
|
void hsl2rgb(struct Rgb *dest, const struct Hls const *src) { |
|
|
|
|
if ((src -> h < 0 || 360 < src -> h) || |
|
|
|
@ -150,6 +137,7 @@ static void b(char * const str) {
@@ -150,6 +137,7 @@ static void b(char * const str) {
|
|
|
|
|
#define IS_DIGIT(x) (x >= ASCII_ZERO && x <= ASCII_NINE) |
|
|
|
|
char *token = strtok(str, "^"); |
|
|
|
|
char c; |
|
|
|
|
printf("<TD>"); |
|
|
|
|
while (token) { |
|
|
|
|
c = token[0]; |
|
|
|
|
if (IS_DIGIT(c)) { |
|
|
|
@ -163,10 +151,9 @@ static void b(char * const str) {
@@ -163,10 +151,9 @@ static void b(char * const str) {
|
|
|
|
|
} |
|
|
|
|
token = strtok(NULL, "^"); |
|
|
|
|
} |
|
|
|
|
printf("</span>"); |
|
|
|
|
printf("</span></TD>"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// O(n)
|
|
|
|
|
void print_plname(const char* str) { |
|
|
|
|
//find instance of ^^
|
|
|
|
|
//replace with ^
|
|
|
|
|