From e87abfa7bc3642a59045ab9e9a24fe296b66abd6 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 4 Jul 2018 18:26:57 +0200 Subject: X11 colors conversion program. --- extra/x11_colors.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 extra/x11_colors.c (limited to 'extra') diff --git a/extra/x11_colors.c b/extra/x11_colors.c new file mode 100644 index 00000000..f3e20783 --- /dev/null +++ b/extra/x11_colors.c @@ -0,0 +1,42 @@ +#include +#include + +int main() +{ + FILE* f = fopen( "rgb.txt", "rb" ); + + char buf[1024]; + int off = 0; + for(;;) + { + int sz = fread( buf+off, 1, 1, f ); + if( buf[off] == '\r' || buf[off] == '\n' || sz == 0 ) + { + if( off == 0 ) + { + if( sz == 0 ) break; + continue; + } + int ok = 1; + for( int i=13; i