aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/col.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2012-06-12 10:10:01 +0000
committerCarsten Haitzler <raster@rasterman.com>2012-06-12 10:10:01 +0000
commit8b822a61d7721fce16e145b57dc67ca6ae8b752d (patch)
tree5268a6ea253ec4452da8a6007069aaff058e8125 /src/bin/col.c
downloadterminology-8b822a61d7721fce16e145b57dc67ca6ae8b752d.tar.gz
finally a terminal emulator for efl! sure - uses a lot of text
objects. need evas textgrid obj and more, but this marks a first "usable" state for terminology. more needs doing like underline and strikethrough support, blink support, visual bell, config panel etc. SVN revision: 72007
Diffstat (limited to 'src/bin/col.c')
-rw-r--r--src/bin/col.c332
1 files changed, 332 insertions, 0 deletions
diff --git a/src/bin/col.c b/src/bin/col.c
new file mode 100644
index 0000000..3268082
--- /dev/null
+++ b/src/bin/col.c
@@ -0,0 +1,332 @@
+#include "col.h"
+
+const Color colors[2][11] =
+{
+ { // normal
+ { 0xaa, 0xaa, 0xaa, 0xff }, // COL_DEF
+ { 0x00, 0x00, 0x00, 0xff }, // COL_BLACK
+ { 0xcc, 0x33, 0x33, 0xff }, // COL_RED
+ { 0x33, 0xcc, 0x33, 0xff }, // COL_GREEN
+ { 0xcc, 0x88, 0x33, 0xff }, // COL_YELLOW
+ { 0x33, 0x33, 0xcc, 0xff }, // COL_BLUE
+ { 0xcc, 0x33, 0xcc, 0xff }, // COL_MAGENTA
+ { 0x33, 0xcc, 0xcc, 0xff }, // COL_CYAN
+ { 0xcc, 0xcc, 0xcc, 0xff }, // COL_WHITE
+ { 0x22, 0x22, 0x22, 0xff }, // COL_INVERSE
+ { 0xaa, 0xaa, 0xaa, 0xff }, // COL_INVERSEBG
+ },
+ { // bright/bold
+ { 0xee, 0xee, 0xee, 0xff }, // COL_DEF
+ { 0x66, 0x66, 0x66, 0xff }, // COL_BLACK
+ { 0xff, 0x66, 0x66, 0xff }, // COL_RED
+ { 0x66, 0xff, 0x66, 0xff }, // COL_GREEN
+ { 0xff, 0xff, 0x66, 0xff }, // COL_YELLOW
+ { 0x66, 0x66, 0xff, 0xff }, // COL_BLUE
+ { 0xff, 0x66, 0xff, 0xff }, // COL_MAGENTA
+ { 0x66, 0xff, 0xff, 0xff }, // COL_CYAN
+ { 0xff, 0xff, 0xff, 0xff }, // COL_WHITE
+ { 0x11, 0x11, 0x11, 0xff }, // COL_INVERSE
+ { 0xee, 0xee, 0xee, 0xff }, // COL_INVERSEBG
+ }
+};
+
+const Color colors256[256] =
+{
+ // basic 16 repeated
+ { 0x00, 0x00, 0x00, 0xff }, // COL_BLACK
+ { 0xcc, 0x33, 0x33, 0xff }, // COL_RED
+ { 0x33, 0xcc, 0x33, 0xff }, // COL_GREEN
+ { 0xcc, 0x88, 0x33, 0xff }, // COL_YELLOW
+ { 0x33, 0x33, 0xcc, 0xff }, // COL_BLUE
+ { 0xcc, 0x33, 0xcc, 0xff }, // COL_MAGENTA
+ { 0x33, 0xcc, 0xcc, 0xff }, // COL_CYAN
+ { 0xcc, 0xcc, 0xcc, 0xff }, // COL_WHITE
+
+ { 0x66, 0x66, 0x66, 0xff }, // COL_BLACK
+ { 0xff, 0x66, 0x66, 0xff }, // COL_RED
+ { 0x66, 0xff, 0x66, 0xff }, // COL_GREEN
+ { 0xff, 0xff, 0x66, 0xff }, // COL_YELLOW
+ { 0x66, 0x66, 0xff, 0xff }, // COL_BLUE
+ { 0xff, 0x66, 0xff, 0xff }, // COL_MAGENTA
+ { 0x66, 0xff, 0xff, 0xff }, // COL_CYAN
+ { 0xff, 0xff, 0xff, 0xff }, // COL_WHITE
+
+ // pure 6x6x6 colorcube
+ { 0x00, 0x00, 0x00, 0xff },
+ { 0x00, 0x00, 0x5f, 0xff },
+ { 0x00, 0x00, 0x87, 0xff },
+ { 0x00, 0x00, 0xaf, 0xff },
+ { 0x00, 0x00, 0xd7, 0xff },
+ { 0x00, 0x00, 0xff, 0xff },
+
+ { 0x00, 0x5f, 0x00, 0xff },
+ { 0x00, 0x5f, 0x5f, 0xff },
+ { 0x00, 0x5f, 0x87, 0xff },
+ { 0x00, 0x5f, 0xaf, 0xff },
+ { 0x00, 0x5f, 0xd7, 0xff },
+ { 0x00, 0x5f, 0xff, 0xff },
+
+ { 0x00, 0x87, 0x00, 0xff },
+ { 0x00, 0x87, 0x5f, 0xff },
+ { 0x00, 0x87, 0x87, 0xff },
+ { 0x00, 0x87, 0xaf, 0xff },
+ { 0x00, 0x87, 0xd7, 0xff },
+ { 0x00, 0x87, 0xff, 0xff },
+
+ { 0x00, 0xaf, 0x00, 0xff },
+ { 0x00, 0xaf, 0x5f, 0xff },
+ { 0x00, 0xaf, 0x87, 0xff },
+ { 0x00, 0xaf, 0xaf, 0xff },
+ { 0x00, 0xaf, 0xd7, 0xff },
+ { 0x00, 0xaf, 0xff, 0xff },
+
+ { 0x00, 0xd7, 0x00, 0xff },
+ { 0x00, 0xd7, 0x5f, 0xff },
+ { 0x00, 0xd7, 0x87, 0xff },
+ { 0x00, 0xd7, 0xaf, 0xff },
+ { 0x00, 0xd7, 0xd7, 0xff },
+ { 0x00, 0xd7, 0xff, 0xff },
+
+ { 0x00, 0xff, 0x00, 0xff },
+ { 0x00, 0xff, 0x5f, 0xff },
+ { 0x00, 0xff, 0x87, 0xff },
+ { 0x00, 0xff, 0xaf, 0xff },
+ { 0x00, 0xff, 0xd7, 0xff },
+ { 0x00, 0xff, 0xff, 0xff },
+
+ { 0x5f, 0x00, 0x00, 0xff },
+ { 0x5f, 0x00, 0x5f, 0xff },
+ { 0x5f, 0x00, 0x87, 0xff },
+ { 0x5f, 0x00, 0xaf, 0xff },
+ { 0x5f, 0x00, 0xd7, 0xff },
+ { 0x5f, 0x00, 0xff, 0xff },
+
+ { 0x5f, 0x5f, 0x00, 0xff },
+ { 0x5f, 0x5f, 0x5f, 0xff },
+ { 0x5f, 0x5f, 0x87, 0xff },
+ { 0x5f, 0x5f, 0xaf, 0xff },
+ { 0x5f, 0x5f, 0xd7, 0xff },
+ { 0x5f, 0x5f, 0xff, 0xff },
+
+ { 0x5f, 0x87, 0x00, 0xff },
+ { 0x5f, 0x87, 0x5f, 0xff },
+ { 0x5f, 0x87, 0x87, 0xff },
+ { 0x5f, 0x87, 0xaf, 0xff },
+ { 0x5f, 0x87, 0xd7, 0xff },
+ { 0x5f, 0x87, 0xff, 0xff },
+
+ { 0x5f, 0xaf, 0x00, 0xff },
+ { 0x5f, 0xaf, 0x5f, 0xff },
+ { 0x5f, 0xaf, 0x87, 0xff },
+ { 0x5f, 0xaf, 0xaf, 0xff },
+ { 0x5f, 0xaf, 0xd7, 0xff },
+ { 0x5f, 0xaf, 0xff, 0xff },
+
+ { 0x5f, 0xd7, 0x00, 0xff },
+ { 0x5f, 0xd7, 0x5f, 0xff },
+ { 0x5f, 0xd7, 0x87, 0xff },
+ { 0x5f, 0xd7, 0xaf, 0xff },
+ { 0x5f, 0xd7, 0xd7, 0xff },
+ { 0x5f, 0xd7, 0xff, 0xff },
+
+ { 0x5f, 0xff, 0x00, 0xff },
+ { 0x5f, 0xff, 0x5f, 0xff },
+ { 0x5f, 0xff, 0x87, 0xff },
+ { 0x5f, 0xff, 0xaf, 0xff },
+ { 0x5f, 0xff, 0xd7, 0xff },
+ { 0x5f, 0xff, 0xff, 0xff },
+
+ { 0x87, 0x00, 0x00, 0xff },
+ { 0x87, 0x00, 0x5f, 0xff },
+ { 0x87, 0x00, 0x87, 0xff },
+ { 0x87, 0x00, 0xaf, 0xff },
+ { 0x87, 0x00, 0xd7, 0xff },
+ { 0x87, 0x00, 0xff, 0xff },
+
+ { 0x87, 0x5f, 0x00, 0xff },
+ { 0x87, 0x5f, 0x5f, 0xff },
+ { 0x87, 0x5f, 0x87, 0xff },
+ { 0x87, 0x5f, 0xaf, 0xff },
+ { 0x87, 0x5f, 0xd7, 0xff },
+ { 0x87, 0x5f, 0xff, 0xff },
+
+ { 0x87, 0x87, 0x00, 0xff },
+ { 0x87, 0x87, 0x5f, 0xff },
+ { 0x87, 0x87, 0x87, 0xff },
+ { 0x87, 0x87, 0xaf, 0xff },
+ { 0x87, 0x87, 0xd7, 0xff },
+ { 0x87, 0x87, 0xff, 0xff },
+
+ { 0x87, 0xaf, 0x00, 0xff },
+ { 0x87, 0xaf, 0x5f, 0xff },
+ { 0x87, 0xaf, 0x87, 0xff },
+ { 0x87, 0xaf, 0xaf, 0xff },
+ { 0x87, 0xaf, 0xd7, 0xff },
+ { 0x87, 0xaf, 0xff, 0xff },
+
+ { 0x87, 0xd7, 0x00, 0xff },
+ { 0x87, 0xd7, 0x5f, 0xff },
+ { 0x87, 0xd7, 0x87, 0xff },
+ { 0x87, 0xd7, 0xaf, 0xff },
+ { 0x87, 0xd7, 0xd7, 0xff },
+ { 0x87, 0xd7, 0xff, 0xff },
+
+ { 0x87, 0xff, 0x00, 0xff },
+ { 0x87, 0xff, 0x5f, 0xff },
+ { 0x87, 0xff, 0x87, 0xff },
+ { 0x87, 0xff, 0xaf, 0xff },
+ { 0x87, 0xff, 0xd7, 0xff },
+ { 0x87, 0xff, 0xff, 0xff },
+
+ { 0xaf, 0x00, 0x00, 0xff },
+ { 0xaf, 0x00, 0x5f, 0xff },
+ { 0xaf, 0x00, 0x87, 0xff },
+ { 0xaf, 0x00, 0xaf, 0xff },
+ { 0xaf, 0x00, 0xd7, 0xff },
+ { 0xaf, 0x00, 0xff, 0xff },
+
+ { 0xaf, 0x5f, 0x00, 0xff },
+ { 0xaf, 0x5f, 0x5f, 0xff },
+ { 0xaf, 0x5f, 0x87, 0xff },
+ { 0xaf, 0x5f, 0xaf, 0xff },
+ { 0xaf, 0x5f, 0xd7, 0xff },
+ { 0xaf, 0x5f, 0xff, 0xff },
+
+ { 0xaf, 0x87, 0x00, 0xff },
+ { 0xaf, 0x87, 0x5f, 0xff },
+ { 0xaf, 0x87, 0x87, 0xff },
+ { 0xaf, 0x87, 0xaf, 0xff },
+ { 0xaf, 0x87, 0xd7, 0xff },
+ { 0xaf, 0x87, 0xff, 0xff },
+
+ { 0xaf, 0xaf, 0x00, 0xff },
+ { 0xaf, 0xaf, 0x5f, 0xff },
+ { 0xaf, 0xaf, 0x87, 0xff },
+ { 0xaf, 0xaf, 0xaf, 0xff },
+ { 0xaf, 0xaf, 0xd7, 0xff },
+ { 0xaf, 0xaf, 0xff, 0xff },
+
+ { 0xaf, 0xd7, 0x00, 0xff },
+ { 0xaf, 0xd7, 0x5f, 0xff },
+ { 0xaf, 0xd7, 0x87, 0xff },
+ { 0xaf, 0xd7, 0xaf, 0xff },
+ { 0xaf, 0xd7, 0xd7, 0xff },
+ { 0xaf, 0xd7, 0xff, 0xff },
+
+ { 0xaf, 0xff, 0x00, 0xff },
+ { 0xaf, 0xff, 0x5f, 0xff },
+ { 0xaf, 0xff, 0x87, 0xff },
+ { 0xaf, 0xff, 0xaf, 0xff },
+ { 0xaf, 0xff, 0xd7, 0xff },
+ { 0xaf, 0xff, 0xff, 0xff },
+
+ { 0xd7, 0x00, 0x00, 0xff },
+ { 0xd7, 0x00, 0x5f, 0xff },
+ { 0xd7, 0x00, 0x87, 0xff },
+ { 0xd7, 0x00, 0xaf, 0xff },
+ { 0xd7, 0x00, 0xd7, 0xff },
+ { 0xd7, 0x00, 0xff, 0xff },
+
+ { 0xd7, 0x5f, 0x00, 0xff },
+ { 0xd7, 0x5f, 0x5f, 0xff },
+ { 0xd7, 0x5f, 0x87, 0xff },
+ { 0xd7, 0x5f, 0xaf, 0xff },
+ { 0xd7, 0x5f, 0xd7, 0xff },
+ { 0xd7, 0x5f, 0xff, 0xff },
+
+ { 0xd7, 0x87, 0x00, 0xff },
+ { 0xd7, 0x87, 0x5f, 0xff },
+ { 0xd7, 0x87, 0x87, 0xff },
+ { 0xd7, 0x87, 0xaf, 0xff },
+ { 0xd7, 0x87, 0xd7, 0xff },
+ { 0xd7, 0x87, 0xff, 0xff },
+
+ { 0xd7, 0xaf, 0x00, 0xff },
+ { 0xd7, 0xaf, 0x5f, 0xff },
+ { 0xd7, 0xaf, 0x87, 0xff },
+ { 0xd7, 0xaf, 0xaf, 0xff },
+ { 0xd7, 0xaf, 0xd7, 0xff },
+ { 0xd7, 0xaf, 0xff, 0xff },
+
+ { 0xd7, 0xd7, 0x00, 0xff },
+ { 0xd7, 0xd7, 0x5f, 0xff },
+ { 0xd7, 0xd7, 0x87, 0xff },
+ { 0xd7, 0xd7, 0xaf, 0xff },
+ { 0xd7, 0xd7, 0xd7, 0xff },
+ { 0xd7, 0xd7, 0xff, 0xff },
+
+ { 0xd7, 0xff, 0x00, 0xff },
+ { 0xd7, 0xff, 0x5f, 0xff },
+ { 0xd7, 0xff, 0x87, 0xff },
+ { 0xd7, 0xff, 0xaf, 0xff },
+ { 0xd7, 0xff, 0xd7, 0xff },
+ { 0xd7, 0xff, 0xff, 0xff },
+
+ { 0xff, 0x00, 0x00, 0xff },
+ { 0xff, 0x00, 0x5f, 0xff },
+ { 0xff, 0x00, 0x87, 0xff },
+ { 0xff, 0x00, 0xaf, 0xff },
+ { 0xff, 0x00, 0xd7, 0xff },
+ { 0xff, 0x00, 0xff, 0xff },
+
+ { 0xff, 0x5f, 0x00, 0xff },
+ { 0xff, 0x5f, 0x5f, 0xff },
+ { 0xff, 0x5f, 0x87, 0xff },
+ { 0xff, 0x5f, 0xaf, 0xff },
+ { 0xff, 0x5f, 0xd7, 0xff },
+ { 0xff, 0x5f, 0xff, 0xff },
+
+ { 0xff, 0x87, 0x00, 0xff },
+ { 0xff, 0x87, 0x5f, 0xff },
+ { 0xff, 0x87, 0x87, 0xff },
+ { 0xff, 0x87, 0xaf, 0xff },
+ { 0xff, 0x87, 0xd7, 0xff },
+ { 0xff, 0x87, 0xff, 0xff },
+
+ { 0xff, 0xaf, 0x00, 0xff },
+ { 0xff, 0xaf, 0x5f, 0xff },
+ { 0xff, 0xaf, 0x87, 0xff },
+ { 0xff, 0xaf, 0xaf, 0xff },
+ { 0xff, 0xaf, 0xd7, 0xff },
+ { 0xff, 0xaf, 0xff, 0xff },
+
+ { 0xff, 0xd7, 0x00, 0xff },
+ { 0xff, 0xd7, 0x5f, 0xff },
+ { 0xff, 0xd7, 0x87, 0xff },
+ { 0xff, 0xd7, 0xaf, 0xff },
+ { 0xff, 0xd7, 0xd7, 0xff },
+ { 0xff, 0xd7, 0xff, 0xff },
+
+ { 0xff, 0xff, 0x00, 0xff },
+ { 0xff, 0xff, 0x5f, 0xff },
+ { 0xff, 0xff, 0x87, 0xff },
+ { 0xff, 0xff, 0xaf, 0xff },
+ { 0xff, 0xff, 0xd7, 0xff },
+ { 0xff, 0xff, 0xff, 0xff },
+
+ // greyscale ramp (24 not including black and white, so 26 if included)
+ { 0x08, 0x08, 0x08, 0xff },
+ { 0x12, 0x12, 0x12, 0xff },
+ { 0x1c, 0x1c, 0x1c, 0xff },
+ { 0x26, 0x26, 0x26, 0xff },
+ { 0x30, 0x30, 0x30, 0xff },
+ { 0x3a, 0x3a, 0x3a, 0xff },
+ { 0x44, 0x44, 0x44, 0xff },
+ { 0x4e, 0x4e, 0x4e, 0xff },
+ { 0x58, 0x58, 0x58, 0xff },
+ { 0x62, 0x62, 0x62, 0xff },
+ { 0x6c, 0x6c, 0x6c, 0xff },
+ { 0x76, 0x76, 0x76, 0xff },
+ { 0x80, 0x80, 0x80, 0xff },
+ { 0x8a, 0x8a, 0x8a, 0xff },
+ { 0x94, 0x94, 0x94, 0xff },
+ { 0x9e, 0x9e, 0x9e, 0xff },
+ { 0xa8, 0xa8, 0xa8, 0xff },
+ { 0xb2, 0xb2, 0xb2, 0xff },
+ { 0xbc, 0xbc, 0xbc, 0xff },
+ { 0xc6, 0xc6, 0xc6, 0xff },
+ { 0xd0, 0xd0, 0xd0, 0xff },
+ { 0xda, 0xda, 0xda, 0xff },
+ { 0xe4, 0xe4, 0xe4, 0xff },
+ { 0xee, 0xee, 0xee, 0xff },
+};