2021-06-15 04:35:41 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Check whether the terminal colours filtered by our algorithm are legible
|
|
|
|
export example=$(
|
2021-06-25 06:35:00 +02:00
|
|
|
tcc "-run -lm" - <<-END
|
2021-06-15 04:35:41 +02:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
2021-06-25 06:35:00 +02:00
|
|
|
#define N_ELEMENTS(a) (sizeof (a) / sizeof ((a)[0]))
|
|
|
|
|
|
|
|
$(perl -0777 -ne 'print $& if /^.*?\nfilter_color(?s:.*?)^}$/m' \
|
|
|
|
"$(dirname "$0")"/degesch.c)
|
2021-06-15 04:35:41 +02:00
|
|
|
|
|
|
|
void main () {
|
|
|
|
size_t len = 0;
|
|
|
|
int *table = filter_color_cube_for_acceptable_nick_colors (&len);
|
|
|
|
for (size_t i = 0; i < len; i++)
|
|
|
|
printf ("<@\\x1b[38;5;%dmIRCuser\\x1b[m> I'm typing!\n", table[i]);
|
|
|
|
}
|
2021-06-25 06:35:00 +02:00
|
|
|
END
|
2021-06-15 04:35:41 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Both should give acceptable results,
|
|
|
|
# which results in a bad compromise that the main author himself needs
|
|
|
|
xterm -bg black -fg white -e 'echo $example; cat' &
|
|
|
|
xterm -bg white -fg black -e 'echo $example; cat' &
|