X-Git-Url: https://vcs.fsf.org/?p=rainbowstream.git;a=blobdiff_plain;f=rainbowstream%2Fimage.c;h=10aa6bbe944f4506aa43f06054fd2a029576dfa5;hp=5de90b03a061fc830fe1a93cd04c533f04fb1c02;hb=bb03272e3286e31f09e30a72159d3b683fefb7fb;hpb=60431c3bca32cf69f00f680dd5d4475d0a365ddc diff --git a/rainbowstream/image.c b/rainbowstream/image.c index 5de90b0..10aa6bb 100644 --- a/rainbowstream/image.c +++ b/rainbowstream/image.c @@ -1,10 +1,15 @@ +/* + * This source is borrowed from folowwing link + * https://github.com/jart/fabulous/blob/master/fabulous/_xterm256.c + * I make a slightly change to fit my module here + */ typedef struct { int r; int g; int b; } rgb_t; int CUBE_STEPS[] = { 0x00, 0x5F, 0x87, 0xAF, 0xD7, 0xFF }; -rgb_t BASIC16[] = +rgb_t BASIC16[] = { { 0, 0, 0 }, { 205, 0, 0}, { 0, 205, 0 }, { 205, 205, 0 }, { 0, 0, 238}, { 205, 0, 205 }, { 0, 205, 205 }, { 229, 229, 229}, { 127, 127, 127 }, @@ -14,7 +19,7 @@ rgb_t BASIC16[] = rgb_t COLOR_TABLE[256]; -rgb_t xterm_to_rgb(int xcolor) +rgb_t ansi_to_rgb(int xcolor) { rgb_t res; if (xcolor < 16) { @@ -34,7 +39,7 @@ int init() { int c; for (c = 0; c < 256; c++) { - COLOR_TABLE[c] = xterm_to_rgb(c); + COLOR_TABLE[c] = ansi_to_rgb(c); } return 0; }