cosmopolitan/tool/viz/xterm256info.c

1220 lines
48 KiB
C

/*-*- mode:c;indent-tabs-mode:nil;c-basic-offset:2;tab-width:8;coding:utf-8 -*-│
│vi: set net ft=c ts=2 sts=2 sw=2 fenc=utf-8 :vi│
╞══════════════════════════════════════════════════════════════════════════════╡
│ Copyright 2020 Justine Alexandra Roberts Tunney │
│ │
│ This program is free software; you can redistribute it and/or modify │
│ it under the terms of the GNU General Public License as published by │
│ the Free Software Foundation; version 2 of the License. │
│ │
│ This program is distributed in the hope that it will be useful, but │
│ WITHOUT ANY WARRANTY; without even the implied warranty of │
│ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU │
│ General Public License for more details. │
│ │
│ You should have received a copy of the GNU General Public License │
│ along with this program; if not, write to the Free Software │
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
│ 02110-1301 USA │
╚─────────────────────────────────────────────────────────────────────────────*/
#include "libc/stdio/stdio.h"
struct Rgb {
uint8_t r, g, b;
};
const struct Rgb kTango[16] = {
{0x00, 0x00, 0x00}, {0x80, 0x00, 0x00}, {0x00, 0x80, 0x00},
{0x80, 0x80, 0x00}, {0x00, 0x00, 0x80}, {0x80, 0x00, 0x80},
{0x00, 0x80, 0x80}, {0xc0, 0xc0, 0xc0}, {0x80, 0x80, 0x80},
{0xff, 0x00, 0x00}, {0x00, 0xff, 0x00}, {0xff, 0xff, 0x00},
{0x00, 0x00, 0xff}, {0xff, 0x00, 0xff}, {0x00, 0xff, 0xff},
{0xff, 0xff, 0xff},
};
const struct Rgb kXtermRgb[] = {
/* 0..15: ansi 16-color palette */
{0x00, 0x00, 0x00},
{0x80, 0x00, 0x00},
{0x00, 0x80, 0x00},
{0x80, 0x80, 0x00},
{0x00, 0x00, 0x80},
{0x80, 0x00, 0x80},
{0x00, 0x80, 0x80},
{0xc0, 0xc0, 0xc0},
{0x80, 0x80, 0x80},
{0xff, 0x00, 0x00},
{0x00, 0xff, 0x00},
{0xff, 0xff, 0x00},
{0x00, 0x00, 0xff},
{0xff, 0x00, 0xff},
{0x00, 0xff, 0xff},
{0xff, 0xff, 0xff},
/* 16..231: xterm256 color cubes */
{0x00, 0x00, 0x00},
{0x00, 0x00, 0x5f},
{0x00, 0x00, 0x87},
{0x00, 0x00, 0xaf},
{0x00, 0x00, 0xd7},
{0x00, 0x00, 0xff},
{0x00, 0x5f, 0x00},
{0x00, 0x5f, 0x5f},
{0x00, 0x5f, 0x87},
{0x00, 0x5f, 0xaf},
{0x00, 0x5f, 0xd7},
{0x00, 0x5f, 0xff},
{0x00, 0x87, 0x00},
{0x00, 0x87, 0x5f},
{0x00, 0x87, 0x87},
{0x00, 0x87, 0xaf},
{0x00, 0x87, 0xd7},
{0x00, 0x87, 0xff},
{0x00, 0xaf, 0x00},
{0x00, 0xaf, 0x5f},
{0x00, 0xaf, 0x87},
{0x00, 0xaf, 0xaf},
{0x00, 0xaf, 0xd7},
{0x00, 0xaf, 0xff},
{0x00, 0xd7, 0x00},
{0x00, 0xd7, 0x5f},
{0x00, 0xd7, 0x87},
{0x00, 0xd7, 0xaf},
{0x00, 0xd7, 0xd7},
{0x00, 0xd7, 0xff},
{0x00, 0xff, 0x00},
{0x00, 0xff, 0x5f},
{0x00, 0xff, 0x87},
{0x00, 0xff, 0xaf},
{0x00, 0xff, 0xd7},
{0x00, 0xff, 0xff},
{0x5f, 0x00, 0x00},
{0x5f, 0x00, 0x5f},
{0x5f, 0x00, 0x87},
{0x5f, 0x00, 0xaf},
{0x5f, 0x00, 0xd7},
{0x5f, 0x00, 0xff},
{0x5f, 0x5f, 0x00},
{0x5f, 0x5f, 0x5f},
{0x5f, 0x5f, 0x87},
{0x5f, 0x5f, 0xaf},
{0x5f, 0x5f, 0xd7},
{0x5f, 0x5f, 0xff},
{0x5f, 0x87, 0x00},
{0x5f, 0x87, 0x5f},
{0x5f, 0x87, 0x87},
{0x5f, 0x87, 0xaf},
{0x5f, 0x87, 0xd7},
{0x5f, 0x87, 0xff},
{0x5f, 0xaf, 0x00},
{0x5f, 0xaf, 0x5f},
{0x5f, 0xaf, 0x87},
{0x5f, 0xaf, 0xaf},
{0x5f, 0xaf, 0xd7},
{0x5f, 0xaf, 0xff},
{0x5f, 0xd7, 0x00},
{0x5f, 0xd7, 0x5f},
{0x5f, 0xd7, 0x87},
{0x5f, 0xd7, 0xaf},
{0x5f, 0xd7, 0xd7},
{0x5f, 0xd7, 0xff},
{0x5f, 0xff, 0x00},
{0x5f, 0xff, 0x5f},
{0x5f, 0xff, 0x87},
{0x5f, 0xff, 0xaf},
{0x5f, 0xff, 0xd7},
{0x5f, 0xff, 0xff},
{0x87, 0x00, 0x00},
{0x87, 0x00, 0x5f},
{0x87, 0x00, 0x87},
{0x87, 0x00, 0xaf},
{0x87, 0x00, 0xd7},
{0x87, 0x00, 0xff},
{0x87, 0x5f, 0x00},
{0x87, 0x5f, 0x5f},
{0x87, 0x5f, 0x87},
{0x87, 0x5f, 0xaf},
{0x87, 0x5f, 0xd7},
{0x87, 0x5f, 0xff},
{0x87, 0x87, 0x00},
{0x87, 0x87, 0x5f},
{0x87, 0x87, 0x87},
{0x87, 0x87, 0xaf},
{0x87, 0x87, 0xd7},
{0x87, 0x87, 0xff},
{0x87, 0xaf, 0x00},
{0x87, 0xaf, 0x5f},
{0x87, 0xaf, 0x87},
{0x87, 0xaf, 0xaf},
{0x87, 0xaf, 0xd7},
{0x87, 0xaf, 0xff},
{0x87, 0xd7, 0x00},
{0x87, 0xd7, 0x5f},
{0x87, 0xd7, 0x87},
{0x87, 0xd7, 0xaf},
{0x87, 0xd7, 0xd7},
{0x87, 0xd7, 0xff},
{0x87, 0xff, 0x00},
{0x87, 0xff, 0x5f},
{0x87, 0xff, 0x87},
{0x87, 0xff, 0xaf},
{0x87, 0xff, 0xd7},
{0x87, 0xff, 0xff},
{0xaf, 0x00, 0x00},
{0xaf, 0x00, 0x5f},
{0xaf, 0x00, 0x87},
{0xaf, 0x00, 0xaf},
{0xaf, 0x00, 0xd7},
{0xaf, 0x00, 0xff},
{0xaf, 0x5f, 0x00},
{0xaf, 0x5f, 0x5f},
{0xaf, 0x5f, 0x87},
{0xaf, 0x5f, 0xaf},
{0xaf, 0x5f, 0xd7},
{0xaf, 0x5f, 0xff},
{0xaf, 0x87, 0x00},
{0xaf, 0x87, 0x5f},
{0xaf, 0x87, 0x87},
{0xaf, 0x87, 0xaf},
{0xaf, 0x87, 0xd7},
{0xaf, 0x87, 0xff},
{0xaf, 0xaf, 0x00},
{0xaf, 0xaf, 0x5f},
{0xaf, 0xaf, 0x87},
{0xaf, 0xaf, 0xaf},
{0xaf, 0xaf, 0xd7},
{0xaf, 0xaf, 0xff},
{0xaf, 0xd7, 0x00},
{0xaf, 0xd7, 0x5f},
{0xaf, 0xd7, 0x87},
{0xaf, 0xd7, 0xaf},
{0xaf, 0xd7, 0xd7},
{0xaf, 0xd7, 0xff},
{0xaf, 0xff, 0x00},
{0xaf, 0xff, 0x5f},
{0xaf, 0xff, 0x87},
{0xaf, 0xff, 0xaf},
{0xaf, 0xff, 0xd7},
{0xaf, 0xff, 0xff},
{0xd7, 0x00, 0x00},
{0xd7, 0x00, 0x5f},
{0xd7, 0x00, 0x87},
{0xd7, 0x00, 0xaf},
{0xd7, 0x00, 0xd7},
{0xd7, 0x00, 0xff},
{0xd7, 0x5f, 0x00},
{0xd7, 0x5f, 0x5f},
{0xd7, 0x5f, 0x87},
{0xd7, 0x5f, 0xaf},
{0xd7, 0x5f, 0xd7},
{0xd7, 0x5f, 0xff},
{0xd7, 0x87, 0x00},
{0xd7, 0x87, 0x5f},
{0xd7, 0x87, 0x87},
{0xd7, 0x87, 0xaf},
{0xd7, 0x87, 0xd7},
{0xd7, 0x87, 0xff},
{0xd7, 0xaf, 0x00},
{0xd7, 0xaf, 0x5f},
{0xd7, 0xaf, 0x87},
{0xd7, 0xaf, 0xaf},
{0xd7, 0xaf, 0xd7},
{0xd7, 0xaf, 0xff},
{0xd7, 0xd7, 0x00},
{0xd7, 0xd7, 0x5f},
{0xd7, 0xd7, 0x87},
{0xd7, 0xd7, 0xaf},
{0xd7, 0xd7, 0xd7},
{0xd7, 0xd7, 0xff},
{0xd7, 0xff, 0x00},
{0xd7, 0xff, 0x5f},
{0xd7, 0xff, 0x87},
{0xd7, 0xff, 0xaf},
{0xd7, 0xff, 0xd7},
{0xd7, 0xff, 0xff},
{0xff, 0x00, 0x00},
{0xff, 0x00, 0x5f},
{0xff, 0x00, 0x87},
{0xff, 0x00, 0xaf},
{0xff, 0x00, 0xd7},
{0xff, 0x00, 0xff},
{0xff, 0x5f, 0x00},
{0xff, 0x5f, 0x5f},
{0xff, 0x5f, 0x87},
{0xff, 0x5f, 0xaf},
{0xff, 0x5f, 0xd7},
{0xff, 0x5f, 0xff},
{0xff, 0x87, 0x00},
{0xff, 0x87, 0x5f},
{0xff, 0x87, 0x87},
{0xff, 0x87, 0xaf},
{0xff, 0x87, 0xd7},
{0xff, 0x87, 0xff},
{0xff, 0xaf, 0x00},
{0xff, 0xaf, 0x5f},
{0xff, 0xaf, 0x87},
{0xff, 0xaf, 0xaf},
{0xff, 0xaf, 0xd7},
{0xff, 0xaf, 0xff},
{0xff, 0xd7, 0x00},
{0xff, 0xd7, 0x5f},
{0xff, 0xd7, 0x87},
{0xff, 0xd7, 0xaf},
{0xff, 0xd7, 0xd7},
{0xff, 0xd7, 0xff},
{0xff, 0xff, 0x00},
{0xff, 0xff, 0x5f},
{0xff, 0xff, 0x87},
{0xff, 0xff, 0xaf},
{0xff, 0xff, 0xd7},
{0xff, 0xff, 0xff},
/* 232..255: xterm256 grayscale */
{0x08, 0x08, 0x08}, /* 8 */
{0x12, 0x12, 0x12}, /* 10 */
{0x1c, 0x1c, 0x1c}, /* 10 */
{0x26, 0x26, 0x26}, /* 10 */
{0x30, 0x30, 0x30}, /* .. */
{0x3a, 0x3a, 0x3a},
{0x44, 0x44, 0x44},
{0x4e, 0x4e, 0x4e},
{0x58, 0x58, 0x58},
{0x62, 0x62, 0x62},
{0x6c, 0x6c, 0x6c},
{0x76, 0x76, 0x76},
{0x80, 0x80, 0x80},
{0x8a, 0x8a, 0x8a},
{0x94, 0x94, 0x94},
{0x9e, 0x9e, 0x9e},
{0xa8, 0xa8, 0xa8},
{0xb2, 0xb2, 0xb2},
{0xbc, 0xbc, 0xbc},
{0xc6, 0xc6, 0xc6},
{0xd0, 0xd0, 0xd0},
{0xda, 0xda, 0xda},
{0xe4, 0xe4, 0xe4},
{0xee, 0xee, 0xee},
};
const struct Rgb kXtermRgbAppleFg[] = {
{0, 0, 0}, {192, 55, 41}, {48, 187, 49}, {173, 172, 53},
{73, 76, 224}, {209, 65, 209}, {60, 187, 199}, {203, 204, 205},
{154, 155, 156}, {249, 59, 44}, {62, 229, 55}, {234, 234, 62},
{89, 63, 251}, {247, 67, 245}, {48, 239, 239}, {233, 235, 235},
{47, 49, 49}, {60, 46, 142}, {67, 51, 180}, {74, 56, 218},
{82, 62, 248}, {89, 63, 251}, {46, 127, 43}, {46, 127, 127},
{49, 127, 167}, {60, 127, 207}, {63, 127, 241}, {70, 126, 251},
{57, 161, 50}, {47, 161, 122}, {50, 161, 161}, {60, 161, 200},
{53, 161, 237}, {65, 160, 252}, {45, 194, 51}, {58, 194, 118},
{51, 194, 156}, {59, 194, 194}, {48, 194, 233}, {63, 194, 252},
{62, 227, 55}, {55, 227, 115}, {48, 227, 151}, {63, 227, 189},
{52, 227, 227}, {66, 227, 253}, {51, 252, 57}, {53, 252, 111},
{63, 252, 147}, {58, 252, 184}, {59, 252, 222}, {62, 253, 251},
{138, 49, 43}, {134, 55, 134}, {134, 58, 174}, {133, 61, 213},
{134, 67, 244}, {134, 65, 251}, {125, 124, 46}, {124, 125, 125},
{122, 125, 165}, {123, 126, 205}, {124, 126, 243}, {125, 125, 251},
{120, 159, 47}, {118, 159, 121}, {118, 159, 160}, {117, 160, 199},
{118, 160, 238}, {119, 160, 252}, {115, 193, 53}, {113, 193, 117},
{114, 193, 155}, {111, 193, 193}, {113, 194, 232}, {112, 193, 252},
{110, 226, 53}, {108, 226, 114}, {110, 226, 151}, {106, 226, 189},
{105, 227, 227}, {105, 226, 252}, {99, 251, 59}, {103, 251, 111},
{104, 251, 146}, {97, 252, 184}, {102, 252, 221}, {98, 254, 250},
{175, 54, 40}, {172, 58, 130}, {170, 61, 170}, {170, 66, 210},
{169, 67, 245}, {168, 69, 251}, {164, 123, 47}, {162, 123, 124},
{161, 124, 163}, {161, 124, 203}, {160, 125, 238}, {160, 125, 251},
{158, 157, 47}, {157, 158, 120}, {157, 158, 159}, {155, 158, 198},
{155, 159, 236}, {155, 158, 252}, {153, 192, 55}, {152, 192, 117},
{151, 192, 154}, {151, 192, 193}, {150, 192, 231}, {150, 192, 251},
{148, 225, 53}, {147, 225, 114}, {146, 225, 150}, {147, 226, 188},
{145, 226, 226}, {145, 226, 250}, {142, 251, 61}, {141, 251, 111},
{141, 252, 146}, {142, 253, 183}, {139, 254, 221}, {138, 255, 249},
{211, 59, 40}, {209, 63, 126}, {207, 63, 166}, {206, 64, 206},
{205, 69, 243}, {204, 72, 252}, {202, 121, 45}, {201, 122, 122},
{200, 122, 161}, {199, 123, 200}, {199, 124, 238}, {197, 124, 252},
{197, 156, 51}, {195, 156, 119}, {195, 157, 157}, {194, 157, 196},
{193, 157, 234}, {193, 157, 252}, {191, 190, 54}, {190, 190, 116},
{189, 191, 153}, {190, 191, 191}, {188, 191, 229}, {187, 191, 251},
{186, 224, 55}, {185, 224, 113}, {184, 224, 150}, {184, 224, 187},
{184, 225, 225}, {182, 224, 251}, {180, 253, 62}, {180, 253, 111},
{179, 253, 146}, {179, 253, 183}, {179, 254, 220}, {177, 252, 249},
{244, 59, 43}, {243, 62, 123}, {241, 65, 162}, {241, 69, 202},
{240, 70, 238}, {238, 69, 252}, {239, 119, 50}, {238, 120, 120},
{236, 121, 159}, {235, 121, 198}, {235, 123, 236}, {234, 123, 252},
{234, 154, 53}, {233, 154, 118}, {232, 155, 156}, {231, 155, 194},
{231, 156, 233}, {230, 156, 252}, {229, 188, 53}, {228, 189, 115},
{227, 189, 152}, {227, 189, 190}, {226, 189, 228}, {225, 189, 253},
{223, 222, 60}, {223, 223, 113}, {222, 223, 149}, {222, 223, 186},
{222, 223, 224}, {220, 223, 252}, {218, 251, 61}, {217, 251, 109},
{217, 251, 145}, {217, 251, 182}, {216, 251, 219}, {216, 251, 250},
{252, 63, 43}, {252, 64, 120}, {252, 64, 159}, {252, 65, 198},
{252, 67, 236}, {252, 72, 252}, {253, 117, 47}, {253, 118, 118},
{253, 119, 156}, {253, 120, 194}, {253, 120, 233}, {252, 121, 252},
{253, 152, 49}, {252, 152, 116}, {252, 153, 153}, {253, 153, 192},
{252, 154, 229}, {251, 154, 251}, {253, 186, 56}, {251, 187, 114},
{251, 187, 151}, {252, 187, 188}, {252, 188, 226}, {251, 188, 251},
{251, 221, 61}, {250, 221, 112}, {250, 221, 148}, {250, 221, 185},
{251, 222, 222}, {251, 222, 251}, {251, 250, 58}, {250, 250, 109},
{249, 250, 144}, {247, 251, 181}, {247, 253, 218}, {254, 255, 255},
{52, 53, 53}, {57, 58, 59}, {66, 67, 67}, {75, 76, 76},
{84, 85, 85}, {92, 93, 94}, {101, 102, 102}, {109, 111, 111},
{118, 119, 119}, {126, 127, 128}, {134, 136, 136}, {143, 144, 145},
{151, 152, 153}, {159, 161, 161}, {167, 169, 169}, {176, 177, 177},
{184, 185, 186}, {192, 193, 194}, {200, 201, 202}, {208, 209, 210},
{216, 218, 218}, {224, 226, 226}, {232, 234, 234}, {240, 242, 242},
};
const struct Rgb kXtermRgbAppleBg[] = {
{0, 0, 0}, {151, 4, 12}, {23, 164, 26}, {153, 152, 29},
{8, 43, 181}, {177, 25, 176}, {26, 166, 177}, {191, 191, 191},
{132, 132, 132}, {227, 10, 23}, {33, 215, 38}, {229, 228, 49},
{11, 36, 251}, {227, 35, 227}, {39, 229, 228}, {230, 229, 230},
{0, 0, 0}, {1, 7, 93}, {3, 14, 133}, {5, 21, 172},
{7, 28, 211}, {11, 36, 251}, {8, 94, 11}, {10, 95, 95},
{11, 96, 133}, {13, 97, 173}, {15, 99, 212}, {18, 101, 251},
{17, 134, 20}, {18, 134, 96}, {18, 135, 134}, {20, 136, 173},
{21, 137, 212}, {23, 138, 251}, {25, 173, 29}, {26, 174, 98},
{26, 174, 136}, {27, 175, 174}, {28, 175, 213}, {30, 176, 252},
{33, 213, 38}, {34, 213, 101}, {34, 214, 137}, {35, 214, 175},
{36, 215, 214}, {37, 215, 253}, {41, 253, 47}, {42, 253, 104},
{42, 253, 140}, {43, 253, 177}, {44, 254, 215}, {45, 255, 254},
{94, 2, 4}, {94, 8, 94}, {94, 15, 133}, {94, 22, 172},
{95, 29, 211}, {95, 36, 251}, {95, 94, 14}, {95, 95, 95},
{95, 96, 134}, {95, 97, 173}, {96, 99, 212}, {96, 101, 251},
{96, 134, 22}, {96, 134, 96}, {96, 135, 135}, {97, 136, 173},
{97, 137, 212}, {97, 138, 252}, {98, 173, 30}, {98, 174, 98},
{98, 174, 136}, {98, 175, 174}, {98, 176, 213}, {99, 177, 252},
{100, 213, 39}, {100, 213, 101}, {100, 214, 138}, {100, 214, 176},
{101, 215, 214}, {101, 215, 253}, {102, 253, 48}, {103, 253, 104},
{103, 253, 140}, {103, 253, 177}, {103, 254, 215}, {104, 255, 254},
{133, 3, 9}, {133, 10, 94}, {134, 16, 133}, {134, 23, 172},
{134, 30, 212}, {134, 37, 251}, {134, 94, 18}, {134, 95, 96},
{134, 96, 134}, {134, 97, 173}, {135, 99, 212}, {135, 101, 251},
{135, 134, 25}, {135, 134, 97}, {135, 135, 135}, {135, 136, 174},
{135, 137, 213}, {136, 138, 252}, {136, 173, 32}, {136, 174, 99},
{136, 174, 136}, {136, 175, 175}, {136, 176, 213}, {137, 177, 252},
{137, 213, 40}, {137, 213, 102}, {138, 214, 138}, {138, 214, 176},
{138, 215, 214}, {138, 216, 253}, {139, 253, 49}, {139, 253, 105},
{139, 253, 140}, {139, 254, 178}, {140, 254, 216}, {140, 255, 254},
{173, 6, 15}, {173, 12, 95}, {173, 18, 134}, {173, 24, 173},
{173, 31, 212}, {174, 38, 251}, {173, 95, 22}, {174, 95, 96},
{174, 96, 135}, {174, 98, 173}, {174, 99, 212}, {174, 101, 252},
{174, 134, 28}, {174, 135, 98}, {174, 135, 136}, {174, 136, 174},
{174, 137, 213}, {175, 139, 252}, {175, 174, 35}, {175, 174, 100},
{175, 174, 137}, {175, 175, 175}, {175, 176, 214}, {175, 177, 253},
{176, 213, 43}, {176, 213, 102}, {176, 214, 139}, {176, 214, 176},
{176, 215, 215}, {176, 216, 253}, {177, 253, 51}, {177, 253, 105},
{177, 253, 141}, {177, 254, 178}, {178, 254, 216}, {178, 255, 254},
{213, 9, 21}, {213, 15, 96}, {213, 20, 135}, {241, 69, 202},
{213, 32, 212}, {213, 39, 251}, {213, 95, 27}, {213, 96, 97},
{213, 97, 135}, {213, 98, 174}, {213, 100, 213}, {213, 102, 252},
{213, 134, 32}, {213, 135, 99}, {213, 135, 136}, {214, 136, 175},
{214, 137, 213}, {214, 139, 252}, {214, 174, 38}, {214, 174, 101},
{214, 175, 138}, {214, 175, 176}, {214, 176, 214}, {214, 177, 253},
{215, 213, 45}, {215, 214, 103}, {215, 214, 139}, {215, 214, 177},
{215, 215, 215}, {215, 216, 254}, {216, 253, 53}, {216, 253, 106},
{216, 253, 141}, {216, 254, 178}, {216, 254, 216}, {216, 255, 255},
{252, 13, 27}, {252, 18, 98}, {252, 22, 135}, {252, 28, 174},
{252, 34, 213}, {252, 40, 252}, {252, 96, 32}, {252, 96, 99},
{252, 97, 136}, {253, 99, 175}, {253, 100, 213}, {253, 102, 252},
{253, 135, 36}, {253, 135, 100}, {253, 136, 137}, {253, 137, 175},
{253, 138, 214}, {253, 139, 253}, {253, 174, 42}, {253, 174, 102},
{253, 175, 138}, {253, 175, 176}, {253, 176, 215}, {254, 177, 253},
{254, 213, 48}, {254, 214, 105}, {254, 214, 140}, {254, 215, 177},
{254, 215, 216}, {254, 216, 254}, {255, 253, 56}, {255, 253, 108},
{255, 253, 142}, {255, 254, 179}, {255, 254, 217}, {255, 255, 255},
{8, 8, 8}, {18, 18, 18}, {28, 28, 28}, {38, 38, 38},
{48, 48, 48}, {58, 58, 58}, {68, 68, 68}, {78, 78, 78},
{88, 88, 88}, {98, 98, 98}, {108, 108, 108}, {118, 118, 118},
{128, 128, 128}, {138, 138, 138}, {148, 148, 148}, {158, 158, 158},
{168, 168, 168}, {178, 178, 178}, {188, 188, 188}, {198, 198, 198},
{208, 208, 208}, {218, 218, 218}, {228, 228, 228}, {238, 238, 238},
};
const char *const kXtermName[] = {
"Black",
"Maroon",
"Green",
"Olive",
"Navy",
"Purple",
"Teal",
"Silver",
"Grey",
"Red",
"Lime",
"Yellow",
"Blue",
"Fuchsia",
"Aqua",
"White",
"Grey0",
"NavyBlue",
"DarkBlue",
"Blue3",
"Blue3",
"Blue1",
"DarkGreen",
"DeepSkyBlue4",
"DeepSkyBlue4",
"DeepSkyBlue4",
"DodgerBlue3",
"DodgerBlue2",
"Green4",
"SpringGreen4",
"Turquoise4",
"DeepSkyBlue3",
"DeepSkyBlue3",
"DodgerBlue1",
"Green3",
"SpringGreen3",
"DarkCyan",
"LightSeaGreen",
"DeepSkyBlue2",
"DeepSkyBlue1",
"Green3",
"SpringGreen3",
"SpringGreen2",
"Cyan3",
"DarkTurquoise",
"Turquoise2",
"Green1",
"SpringGreen2",
"SpringGreen1",
"MediumSpringGreen",
"Cyan2",
"Cyan1",
"DarkRed",
"DeepPink4",
"Purple4",
"Purple4",
"Purple3",
"BlueViolet",
"Orange4",
"Grey37",
"MediumPurple4",
"SlateBlue3",
"SlateBlue3",
"RoyalBlue1",
"Chartreuse4",
"DarkSeaGreen4",
"PaleTurquoise4",
"SteelBlue",
"SteelBlue3",
"CornflowerBlue",
"Chartreuse3",
"DarkSeaGreen4",
"CadetBlue",
"CadetBlue",
"SkyBlue3",
"SteelBlue1",
"Chartreuse3",
"PaleGreen3",
"SeaGreen3",
"Aquamarine3",
"MediumTurquoise",
"SteelBlue1",
"Chartreuse2",
"SeaGreen2",
"SeaGreen1",
"SeaGreen1",
"Aquamarine1",
"DarkSlateGray2",
"DarkRed",
"DeepPink4",
"DarkMagenta",
"DarkMagenta",
"DarkViolet",
"Purple",
"Orange4",
"LightPink4",
"Plum4",
"MediumPurple3",
"MediumPurple3",
"SlateBlue1",
"Yellow4",
"Wheat4",
"Grey53",
"LightSlateGrey",
"MediumPurple",
"LightSlateBlue",
"Yellow4",
"DarkOliveGreen3",
"DarkSeaGreen",
"LightSkyBlue3",
"LightSkyBlue3",
"SkyBlue2",
"Chartreuse2",
"DarkOliveGreen3",
"PaleGreen3",
"DarkSeaGreen3",
"DarkSlateGray3",
"SkyBlue1",
"Chartreuse1",
"LightGreen",
"LightGreen",
"PaleGreen1",
"Aquamarine1",
"DarkSlateGray1",
"Red3",
"DeepPink4",
"MediumVioletRed",
"Magenta3",
"DarkViolet",
"Purple",
"DarkOrange3",
"IndianRed",
"HotPink3",
"MediumOrchid3",
"MediumOrchid",
"MediumPurple2",
"DarkGoldenrod",
"LightSalmon3",
"RosyBrown",
"Grey63",
"MediumPurple2",
"MediumPurple1",
"Gold3",
"DarkKhaki",
"NavajoWhite3",
"Grey69",
"LightSteelBlue3",
"LightSteelBlue",
"Yellow3",
"DarkOliveGreen3",
"DarkSeaGreen3",
"DarkSeaGreen2",
"LightCyan3",
"LightSkyBlue1",
"GreenYellow",
"DarkOliveGreen2",
"PaleGreen1",
"DarkSeaGreen2",
"DarkSeaGreen1",
"PaleTurquoise1",
"Red3",
"DeepPink3",
"DeepPink3",
"Magenta3",
"Magenta3",
"Magenta2",
"DarkOrange3",
"IndianRed",
"HotPink3",
"HotPink2",
"Orchid",
"MediumOrchid1",
"Orange3",
"LightSalmon3",
"LightPink3",
"Pink3",
"Plum3",
"Violet",
"Gold3",
"LightGoldenrod3",
"Tan",
"MistyRose3",
"Thistle3",
"Plum2",
"Yellow3",
"Khaki3",
"LightGoldenrod2",
"LightYellow3",
"Grey84",
"LightSteelBlue1",
"Yellow2",
"DarkOliveGreen1",
"DarkOliveGreen1",
"DarkSeaGreen1",
"Honeydew2",
"LightCyan1",
"Red1",
"DeepPink2",
"DeepPink1",
"DeepPink1",
"Magenta2",
"Magenta1",
"OrangeRed1",
"IndianRed1",
"IndianRed1",
"HotPink",
"HotPink",
"MediumOrchid1",
"DarkOrange",
"Salmon1",
"LightCoral",
"PaleVioletRed1",
"Orchid2",
"Orchid1",
"Orange1",
"SandyBrown",
"LightSalmon1",
"LightPink1",
"Pink1",
"Plum1",
"Gold1",
"LightGoldenrod2",
"LightGoldenrod2",
"NavajoWhite1",
"MistyRose1",
"Thistle1",
"Yellow1",
"LightGoldenrod1",
"Khaki1",
"Wheat1",
"Cornsilk1",
"Grey100",
"Grey3",
"Grey7",
"Grey11",
"Grey15",
"Grey19",
"Grey23",
"Grey27",
"Grey30",
"Grey35",
"Grey39",
"Grey42",
"Grey46",
"Grey50",
"Grey54",
"Grey58",
"Grey62",
"Grey66",
"Grey70",
"Grey74",
"Grey78",
"Grey82",
"Grey85",
"Grey89",
"Grey93",
};
const struct XtermDb {
struct Rgb rgb;
const char *text;
} kXtermDb[] = {
{{0x00, 0x00, 0x00},
"0 Black #000000 rgb(0,0,0) hsl(0,0%,0%)"},
{{0x80, 0x00, 0x00},
"1 Maroon #800000 rgb(128,0,0) hsl(0,100%,25%)"},
{{0x00, 0x80, 0x00},
"2 Green #008000 rgb(0,128,0) hsl(120,100%,25%)"},
{{0x80, 0x80, 0x00},
"3 Olive #808000 rgb(128,128,0) hsl(60,100%,25%)"},
{{0x00, 0x00, 0x80},
"4 Navy #000080 rgb(0,0,128) hsl(240,100%,25%)"},
{{0x80, 0x00, 0x80},
"5 Purple #800080 rgb(128,0,128) hsl(300,100%,25%)"},
{{0x00, 0x80, 0x80},
"6 Teal #008080 rgb(0,128,128) hsl(180,100%,25%)"},
{{0xc0, 0xc0, 0xc0},
"7 Silver #c0c0c0 rgb(192,192,192) hsl(0,0%,75%)"},
{{0x80, 0x80, 0x80},
"8 Grey #808080 rgb(128,128,128) hsl(0,0%,50%)"},
{{0xff, 0x00, 0x00},
"9 Red #ff0000 rgb(255,0,0) hsl(0,100%,50%)"},
{{0x00, 0xff, 0x00},
"10 Lime #00ff00 rgb(0,255,0) hsl(120,100%,50%)"},
{{0xff, 0xff, 0x00},
"11 Yellow #ffff00 rgb(255,255,0) hsl(60,100%,50%)"},
{{0x00, 0x00, 0xff},
"12 Blue #0000ff rgb(0,0,255) hsl(240,100%,50%)"},
{{0xff, 0x00, 0xff},
"13 Fuchsia #ff00ff rgb(255,0,255) hsl(300,100%,50%)"},
{{0x00, 0xff, 0xff},
"14 Aqua #00ffff rgb(0,255,255) hsl(180,100%,50%)"},
{{0xff, 0xff, 0xff},
"15 White #ffffff rgb(255,255,255) hsl(0,0%,100%)"},
{{0x00, 0x00, 0x00},
"16 Grey0 #000000 rgb(0,0,0) hsl(0,0%,0%)"},
{{0x00, 0x00, 0x5f},
"17 NavyBlue #00005f rgb(0,0,95) hsl(240,100%,18%)"},
{{0x00, 0x00, 0x87},
"18 DarkBlue #000087 rgb(0,0,135) hsl(240,100%,26%)"},
{{0x00, 0x00, 0xaf},
"19 Blue3 #0000af rgb(0,0,175) hsl(240,100%,34%)"},
{{0x00, 0x00, 0xd7},
"20 Blue3 #0000d7 rgb(0,0,215) hsl(240,100%,42%)"},
{{0x00, 0x00, 0xff},
"21 Blue1 #0000ff rgb(0,0,255) hsl(240,100%,50%)"},
{{0x00, 0x5f, 0x00},
"22 DarkGreen #005f00 rgb(0,95,0) hsl(120,100%,18%)"},
{{0x00, 0x5f, 0x5f},
"23 DeepSkyBlue4 #005f5f rgb(0,95,95) hsl(180,100%,18%)"},
{{0x00, 0x5f, 0x87},
"24 DeepSkyBlue4 #005f87 rgb(0,95,135) hsl(97,100%,26%)"},
{{0x00, 0x5f, 0xaf},
"25 DeepSkyBlue4 #005faf rgb(0,95,175) hsl(07,100%,34%)"},
{{0x00, 0x5f, 0xd7},
"26 DodgerBlue3 #005fd7 rgb(0,95,215) hsl(13,100%,42%)"},
{{0x00, 0x5f, 0xff},
"27 DodgerBlue2 #005fff rgb(0,95,255) hsl(17,100%,50%)"},
{{0x00, 0x87, 0x00},
"28 Green4 #008700 rgb(0,135,0) hsl(120,100%,26%)"},
{{0x00, 0x87, 0x5f},
"29 SpringGreen4 #00875f rgb(0,135,95) hsl(62,100%,26%)"},
{{0x00, 0x87, 0x87},
"30 Turquoise4 #008787 rgb(0,135,135) hsl(180,100%,26%)"},
{{0x00, 0x87, 0xaf},
"31 DeepSkyBlue3 #0087af rgb(0,135,175) hsl(93,100%,34%)"},
{{0x00, 0x87, 0xd7},
"32 DeepSkyBlue3 #0087d7 rgb(0,135,215) hsl(02,100%,42%)"},
{{0x00, 0x87, 0xff},
"33 DodgerBlue1 #0087ff rgb(0,135,255) hsl(08,100%,50%)"},
{{0x00, 0xaf, 0x00},
"34 Green3 #00af00 rgb(0,175,0) hsl(120,100%,34%)"},
{{0x00, 0xaf, 0x5f},
"35 SpringGreen3 #00af5f rgb(0,175,95) hsl(52,100%,34%)"},
{{0x00, 0xaf, 0x87},
"36 DarkCyan #00af87 rgb(0,175,135) hsl(66,100%,34%)"},
{{0x00, 0xaf, 0xaf},
"37 LightSeaGreen #00afaf rgb(0,175,175) hsl(180,100%,34%)"},
{{0x00, 0xaf, 0xd7},
"38 DeepSkyBlue2 #00afd7 rgb(0,175,215) hsl(91,100%,42%)"},
{{0x00, 0xaf, 0xff},
"39 DeepSkyBlue1 #00afff rgb(0,175,255) hsl(98,100%,50%)"},
{{0x00, 0xd7, 0x00},
"40 Green3 #00d700 rgb(0,215,0) hsl(120,100%,42%)"},
{{0x00, 0xd7, 0x5f},
"41 SpringGreen3 #00d75f rgb(0,215,95) hsl(46,100%,42%)"},
{{0x00, 0xd7, 0x87},
"42 SpringGreen2 #00d787 rgb(0,215,135) hsl(57,100%,42%)"},
{{0x00, 0xd7, 0xaf},
"43 Cyan3 #00d7af rgb(0,215,175) hsl(68,100%,42%)"},
{{0x00, 0xd7, 0xd7},
"44 DarkTurquoise #00d7d7 rgb(0,215,215) hsl(180,100%,42%)"},
{{0x00, 0xd7, 0xff},
"45 Turquoise2 #00d7ff rgb(0,215,255) hsl(89,100%,50%)"},
{{0x00, 0xff, 0x00},
"46 Green1 #00ff00 rgb(0,255,0) hsl(120,100%,50%)"},
{{0x00, 0xff, 0x5f},
"47 SpringGreen2 #00ff5f rgb(0,255,95) hsl(42,100%,50%)"},
{{0x00, 0xff, 0x87},
"48 SpringGreen1 #00ff87 rgb(0,255,135) hsl(51,100%,50%)"},
{{0x00, 0xff, 0xaf},
"49 MediumSpringGreen #00ffaf rgb(0,255,175) hsl(61,100%,50%)"},
{{0x00, 0xff, 0xd7},
"50 Cyan2 #00ffd7 rgb(0,255,215) hsl(70,100%,50%)"},
{{0x00, 0xff, 0xff},
"51 Cyan1 #00ffff rgb(0,255,255) hsl(180,100%,50%)"},
{{0x5f, 0x00, 0x00},
"52 DarkRed #5f0000 rgb(95,0,0) hsl(0,100%,18%)"},
{{0x5f, 0x00, 0x5f},
"53 DeepPink4 #5f005f rgb(95,0,95) hsl(300,100%,18%)"},
{{0x5f, 0x00, 0x87},
"54 Purple4 #5f0087 rgb(95,0,135) hsl(82,100%,26%)"},
{{0x5f, 0x00, 0xaf},
"55 Purple4 #5f00af rgb(95,0,175) hsl(72,100%,34%)"},
{{0x5f, 0x00, 0xd7},
"56 Purple3 #5f00d7 rgb(95,0,215) hsl(66,100%,42%)"},
{{0x5f, 0x00, 0xff},
"57 BlueViolet #5f00ff rgb(95,0,255) hsl(62,100%,50%)"},
{{0x5f, 0x5f, 0x00},
"58 Orange4 #5f5f00 rgb(95,95,0) hsl(60,100%,18%)"},
{{0x5f, 0x5f, 0x5f},
"59 Grey37 #5f5f5f rgb(95,95,95) hsl(0,0%,37%)"},
{{0x5f, 0x5f, 0x87},
"60 MediumPurple4 #5f5f87 rgb(95,95,135) hsl(240,17%,45%)"},
{{0x5f, 0x5f, 0xaf},
"61 SlateBlue3 #5f5faf rgb(95,95,175) hsl(240,33%,52%)"},
{{0x5f, 0x5f, 0xd7},
"62 SlateBlue3 #5f5fd7 rgb(95,95,215) hsl(240,60%,60%)"},
{{0x5f, 0x5f, 0xff},
"63 RoyalBlue1 #5f5fff rgb(95,95,255) hsl(240,100%,68%)"},
{{0x5f, 0x87, 0x00},
"64 Chartreuse4 #5f8700 rgb(95,135,0) hsl(7,100%,26%)"},
{{0x5f, 0x87, 0x5f},
"65 DarkSeaGreen4 #5f875f rgb(95,135,95) hsl(120,17%,45%)"},
{{0x5f, 0x87, 0x87},
"66 PaleTurquoise4 #5f8787 rgb(95,135,135) hsl(180,17%,45%)"},
{{0x5f, 0x87, 0xaf},
"67 SteelBlue #5f87af rgb(95,135,175) hsl(210,33%,52%)"},
{{0x5f, 0x87, 0xd7},
"68 SteelBlue3 #5f87d7 rgb(95,135,215) hsl(220,60%,60%)"},
{{0x5f, 0x87, 0xff},
"69 CornflowerBlue #5f87ff rgb(95,135,255) hsl(225,100%,68%)"},
{{0x5f, 0xaf, 0x00},
"70 Chartreuse3 #5faf00 rgb(95,175,0) hsl(7,100%,34%)"},
{{0x5f, 0xaf, 0x5f},
"71 DarkSeaGreen4 #5faf5f rgb(95,175,95) hsl(120,33%,52%)"},
{{0x5f, 0xaf, 0x87},
"72 CadetBlue #5faf87 rgb(95,175,135) hsl(150,33%,52%)"},
{{0x5f, 0xaf, 0xaf},
"73 CadetBlue #5fafaf rgb(95,175,175) hsl(180,33%,52%)"},
{{0x5f, 0xaf, 0xd7},
"74 SkyBlue3 #5fafd7 rgb(95,175,215) hsl(200,60%,60%)"},
{{0x5f, 0xaf, 0xff},
"75 SteelBlue1 #5fafff rgb(95,175,255) hsl(210,100%,68%)"},
{{0x5f, 0xd7, 0x00},
"76 Chartreuse3 #5fd700 rgb(95,215,0) hsl(3,100%,42%)"},
{{0x5f, 0xd7, 0x5f},
"77 PaleGreen3 #5fd75f rgb(95,215,95) hsl(120,60%,60%)"},
{{0x5f, 0xd7, 0x87},
"78 SeaGreen3 #5fd787 rgb(95,215,135) hsl(140,60%,60%)"},
{{0x5f, 0xd7, 0xaf},
"79 Aquamarine3 #5fd7af rgb(95,215,175) hsl(160,60%,60%)"},
{{0x5f, 0xd7, 0xd7},
"80 MediumTurquoise #5fd7d7 rgb(95,215,215) hsl(180,60%,60%)"},
{{0x5f, 0xd7, 0xff},
"81 SteelBlue1 #5fd7ff rgb(95,215,255) hsl(195,100%,68%)"},
{{0x5f, 0xff, 0x00},
"82 Chartreuse2 #5fff00 rgb(95,255,0) hsl(7,100%,50%)"},
{{0x5f, 0xff, 0x5f},
"83 SeaGreen2 #5fff5f rgb(95,255,95) hsl(120,100%,68%)"},
{{0x5f, 0xff, 0x87},
"84 SeaGreen1 #5fff87 rgb(95,255,135) hsl(135,100%,68%)"},
{{0x5f, 0xff, 0xaf},
"85 SeaGreen1 #5fffaf rgb(95,255,175) hsl(150,100%,68%)"},
{{0x5f, 0xff, 0xd7},
"86 Aquamarine1 #5fffd7 rgb(95,255,215) hsl(165,100%,68%)"},
{{0x5f, 0xff, 0xff},
"87 DarkSlateGray2 #5fffff rgb(95,255,255) hsl(180,100%,68%)"},
{{0x87, 0x00, 0x00},
"88 DarkRed #870000 rgb(135,0,0) hsl(0,100%,26%)"},
{{0x87, 0x00, 0x5f},
"89 DeepPink4 #87005f rgb(135,0,95) hsl(17,100%,26%)"},
{{0x87, 0x00, 0x87},
"90 DarkMagenta #870087 rgb(135,0,135) hsl(300,100%,26%)"},
{{0x87, 0x00, 0xaf},
"91 DarkMagenta #8700af rgb(135,0,175) hsl(86,100%,34%)"},
{{0x87, 0x00, 0xd7},
"92 DarkViolet #8700d7 rgb(135,0,215) hsl(77,100%,42%)"},
{{0x87, 0x00, 0xff},
"93 Purple #8700ff rgb(135,0,255) hsl(71,100%,50%)"},
{{0x87, 0x5f, 0x00},
"94 Orange4 #875f00 rgb(135,95,0) hsl(2,100%,26%)"},
{{0x87, 0x5f, 0x5f},
"95 LightPink4 #875f5f rgb(135,95,95) hsl(0,17%,45%)"},
{{0x87, 0x5f, 0x87},
"96 Plum4 #875f87 rgb(135,95,135) hsl(300,17%,45%)"},
{{0x87, 0x5f, 0xaf},
"97 MediumPurple3 #875faf rgb(135,95,175) hsl(270,33%,52%)"},
{{0x87, 0x5f, 0xd7},
"98 MediumPurple3 #875fd7 rgb(135,95,215) hsl(260,60%,60%)"},
{{0x87, 0x5f, 0xff},
"99 SlateBlue1 #875fff rgb(135,95,255) hsl(255,100%,68%)"},
{{0x87, 0x87, 0x00},
"100 Yellow4 #878700 rgb(135,135,0) hsl(60,100%,26%)"},
{{0x87, 0x87, 0x5f},
"101 Wheat4 #87875f rgb(135,135,95) hsl(60,17%,45%)"},
{{0x87, 0x87, 0x87},
"102 Grey53 #878787 rgb(135,135,135) hsl(0,0%,52%)"},
{{0x87, 0x87, 0xaf},
"103 LightSlateGrey #8787af rgb(135,135,175) hsl(240,20%,60%)"},
{{0x87, 0x87, 0xd7},
"104 MediumPurple #8787d7 rgb(135,135,215) hsl(240,50%,68%)"},
{{0x87, 0x87, 0xff},
"105 LightSlateBlue #8787ff rgb(135,135,255) hsl(240,100%,76%)"},
{{0x87, 0xaf, 0x00},
"106 Yellow4 #87af00 rgb(135,175,0) hsl(3,100%,34%)"},
{{0x87, 0xaf, 0x5f},
"107 DarkOliveGreen3 #87af5f rgb(135,175,95) hsl(90,33%,52%)"},
{{0x87, 0xaf, 0x87},
"108 DarkSeaGreen #87af87 rgb(135,175,135) hsl(120,20%,60%)"},
{{0x87, 0xaf, 0xaf},
"109 LightSkyBlue3 #87afaf rgb(135,175,175) hsl(180,20%,60%)"},
{{0x87, 0xaf, 0xd7},
"110 LightSkyBlue3 #87afd7 rgb(135,175,215) hsl(210,50%,68%)"},
{{0x87, 0xaf, 0xff},
"111 SkyBlue2 #87afff rgb(135,175,255) hsl(220,100%,76%)"},
{{0x87, 0xd7, 0x00},
"112 Chartreuse2 #87d700 rgb(135,215,0) hsl(2,100%,42%)"},
{{0x87, 0xd7, 0x5f},
"113 DarkOliveGreen3 #87d75f rgb(135,215,95) hsl(100,60%,60%)"},
{{0x87, 0xd7, 0x87},
"114 PaleGreen3 #87d787 rgb(135,215,135) hsl(120,50%,68%)"},
{{0x87, 0xd7, 0xaf},
"115 DarkSeaGreen3 #87d7af rgb(135,215,175) hsl(150,50%,68%)"},
{{0x87, 0xd7, 0xd7},
"116 DarkSlateGray3 #87d7d7 rgb(135,215,215) hsl(180,50%,68%)"},
{{0x87, 0xd7, 0xff},
"117 SkyBlue1 #87d7ff rgb(135,215,255) hsl(200,100%,76%)"},
{{0x87, 0xff, 0x00},
"118 Chartreuse1 #87ff00 rgb(135,255,0) hsl(8,100%,50%)"},
{{0x87, 0xff, 0x5f},
"119 LightGreen #87ff5f rgb(135,255,95) hsl(105,100%,68%)"},
{{0x87, 0xff, 0x87},
"120 LightGreen #87ff87 rgb(135,255,135) hsl(120,100%,76%)"},
{{0x87, 0xff, 0xaf},
"121 PaleGreen1 #87ffaf rgb(135,255,175) hsl(140,100%,76%)"},
{{0x87, 0xff, 0xd7},
"122 Aquamarine1 #87ffd7 rgb(135,255,215) hsl(160,100%,76%)"},
{{0x87, 0xff, 0xff},
"123 DarkSlateGray1 #87ffff rgb(135,255,255) hsl(180,100%,76%)"},
{{0xaf, 0x00, 0x00},
"124 Red3 #af0000 rgb(175,0,0) hsl(0,100%,34%)"},
{{0xaf, 0x00, 0x5f},
"125 DeepPink4 #af005f rgb(175,0,95) hsl(27,100%,34%)"},
{{0xaf, 0x00, 0x87},
"126 MediumVioletRed #af0087 rgb(175,0,135) hsl(13,100%,34%)"},
{{0xaf, 0x00, 0xaf},
"127 Magenta3 #af00af rgb(175,0,175) hsl(300,100%,34%)"},
{{0xaf, 0x00, 0xd7},
"128 DarkViolet #af00d7 rgb(175,0,215) hsl(88,100%,42%)"},
{{0xaf, 0x00, 0xff},
"129 Purple #af00ff rgb(175,0,255) hsl(81,100%,50%)"},
{{0xaf, 0x5f, 0x00},
"130 DarkOrange3 #af5f00 rgb(175,95,0) hsl(2,100%,34%)"},
{{0xaf, 0x5f, 0x5f},
"131 IndianRed #af5f5f rgb(175,95,95) hsl(0,33%,52%)"},
{{0xaf, 0x5f, 0x87},
"132 HotPink3 #af5f87 rgb(175,95,135) hsl(330,33%,52%)"},
{{0xaf, 0x5f, 0xaf},
"133 MediumOrchid3 #af5faf rgb(175,95,175) hsl(300,33%,52%)"},
{{0xaf, 0x5f, 0xd7},
"134 MediumOrchid #af5fd7 rgb(175,95,215) hsl(280,60%,60%)"},
{{0xaf, 0x5f, 0xff},
"135 MediumPurple2 #af5fff rgb(175,95,255) hsl(270,100%,68%)"},
{{0xaf, 0x87, 0x00},
"136 DarkGoldenrod #af8700 rgb(175,135,0) hsl(6,100%,34%)"},
{{0xaf, 0x87, 0x5f},
"137 LightSalmon3 #af875f rgb(175,135,95) hsl(30,33%,52%)"},
{{0xaf, 0x87, 0x87},
"138 RosyBrown #af8787 rgb(175,135,135) hsl(0,20%,60%)"},
{{0xaf, 0x87, 0xaf},
"139 Grey63 #af87af rgb(175,135,175) hsl(300,20%,60%)"},
{{0xaf, 0x87, 0xd7},
"140 MediumPurple2 #af87d7 rgb(175,135,215) hsl(270,50%,68%)"},
{{0xaf, 0x87, 0xff},
"141 MediumPurple1 #af87ff rgb(175,135,255) hsl(260,100%,76%)"},
{{0xaf, 0xaf, 0x00},
"142 Gold3 #afaf00 rgb(175,175,0) hsl(60,100%,34%)"},
{{0xaf, 0xaf, 0x5f},
"143 DarkKhaki #afaf5f rgb(175,175,95) hsl(60,33%,52%)"},
{{0xaf, 0xaf, 0x87},
"144 NavajoWhite3 #afaf87 rgb(175,175,135) hsl(60,20%,60%)"},
{{0xaf, 0xaf, 0xaf},
"145 Grey69 #afafaf rgb(175,175,175) hsl(0,0%,68%)"},
{{0xaf, 0xaf, 0xd7},
"146 LightSteelBlue3 #afafd7 rgb(175,175,215) hsl(240,33%,76%)"},
{{0xaf, 0xaf, 0xff},
"147 LightSteelBlue #afafff rgb(175,175,255) hsl(240,100%,84%)"},
{{0xaf, 0xd7, 0x00},
"148 Yellow3 #afd700 rgb(175,215,0) hsl(1,100%,42%)"},
{{0xaf, 0xd7, 0x5f},
"149 DarkOliveGreen3 #afd75f rgb(175,215,95) hsl(80,60%,60%)"},
{{0xaf, 0xd7, 0x87},
"150 DarkSeaGreen3 #afd787 rgb(175,215,135) hsl(90,50%,68%)"},
{{0xaf, 0xd7, 0xaf},
"151 DarkSeaGreen2 #afd7af rgb(175,215,175) hsl(120,33%,76%)"},
{{0xaf, 0xd7, 0xd7},
"152 LightCyan3 #afd7d7 rgb(175,215,215) hsl(180,33%,76%)"},
{{0xaf, 0xd7, 0xff},
"153 LightSkyBlue1 #afd7ff rgb(175,215,255) hsl(210,100%,84%)"},
{{0xaf, 0xff, 0x00},
"154 GreenYellow #afff00 rgb(175,255,0) hsl(8,100%,50%)"},
{{0xaf, 0xff, 0x5f},
"155 DarkOliveGreen2 #afff5f rgb(175,255,95) hsl(90,100%,68%)"},
{{0xaf, 0xff, 0x87},
"156 PaleGreen1 #afff87 rgb(175,255,135) hsl(100,100%,76%)"},
{{0xaf, 0xff, 0xaf},
"157 DarkSeaGreen2 #afffaf rgb(175,255,175) hsl(120,100%,84%)"},
{{0xaf, 0xff, 0xd7},
"158 DarkSeaGreen1 #afffd7 rgb(175,255,215) hsl(150,100%,84%)"},
{{0xaf, 0xff, 0xff},
"159 PaleTurquoise1 #afffff rgb(175,255,255) hsl(180,100%,84%)"},
{{0xd7, 0x00, 0x00},
"160 Red3 #d70000 rgb(215,0,0) hsl(0,100%,42%)"},
{{0xd7, 0x00, 0x5f},
"161 DeepPink3 #d7005f rgb(215,0,95) hsl(33,100%,42%)"},
{{0xd7, 0x00, 0x87},
"162 DeepPink3 #d70087 rgb(215,0,135) hsl(22,100%,42%)"},
{{0xd7, 0x00, 0xaf},
"163 Magenta3 #d700af rgb(215,0,175) hsl(11,100%,42%)"},
{{0xd7, 0x00, 0xd7},
"164 Magenta3 #d700d7 rgb(215,0,215) hsl(300,100%,42%)"},
{{0xd7, 0x00, 0xff},
"165 Magenta2 #d700ff rgb(215,0,255) hsl(90,100%,50%)"},
{{0xd7, 0x5f, 0x00},
"166 DarkOrange3 #d75f00 rgb(215,95,0) hsl(6,100%,42%)"},
{{0xd7, 0x5f, 0x5f},
"167 IndianRed #d75f5f rgb(215,95,95) hsl(0,60%,60%)"},
{{0xd7, 0x5f, 0x87},
"168 HotPink3 #d75f87 rgb(215,95,135) hsl(340,60%,60%)"},
{{0xd7, 0x5f, 0xaf},
"169 HotPink2 #d75faf rgb(215,95,175) hsl(320,60%,60%)"},
{{0xd7, 0x5f, 0xd7},
"170 Orchid #d75fd7 rgb(215,95,215) hsl(300,60%,60%)"},
{{0xd7, 0x5f, 0xff},
"171 MediumOrchid1 #d75fff rgb(215,95,255) hsl(285,100%,68%)"},
{{0xd7, 0x87, 0x00},
"172 Orange3 #d78700 rgb(215,135,0) hsl(7,100%,42%)"},
{{0xd7, 0x87, 0x5f},
"173 LightSalmon3 #d7875f rgb(215,135,95) hsl(20,60%,60%)"},
{{0xd7, 0x87, 0x87},
"174 LightPink3 #d78787 rgb(215,135,135) hsl(0,50%,68%)"},
{{0xd7, 0x87, 0xaf},
"175 Pink3 #d787af rgb(215,135,175) hsl(330,50%,68%)"},
{{0xd7, 0x87, 0xd7},
"176 Plum3 #d787d7 rgb(215,135,215) hsl(300,50%,68%)"},
{{0xd7, 0x87, 0xff},
"177 Violet #d787ff rgb(215,135,255) hsl(280,100%,76%)"},
{{0xd7, 0xaf, 0x00},
"178 Gold3 #d7af00 rgb(215,175,0) hsl(8,100%,42%)"},
{{0xd7, 0xaf, 0x5f},
"179 LightGoldenrod3 #d7af5f rgb(215,175,95) hsl(40,60%,60%)"},
{{0xd7, 0xaf, 0x87},
"180 Tan #d7af87 rgb(215,175,135) hsl(30,50%,68%)"},
{{0xd7, 0xaf, 0xaf},
"181 MistyRose3 #d7afaf rgb(215,175,175) hsl(0,33%,76%)"},
{{0xd7, 0xaf, 0xd7},
"182 Thistle3 #d7afd7 rgb(215,175,215) hsl(300,33%,76%)"},
{{0xd7, 0xaf, 0xff},
"183 Plum2 #d7afff rgb(215,175,255) hsl(270,100%,84%)"},
{{0xd7, 0xd7, 0x00},
"184 Yellow3 #d7d700 rgb(215,215,0) hsl(60,100%,42%)"},
{{0xd7, 0xd7, 0x5f},
"185 Khaki3 #d7d75f rgb(215,215,95) hsl(60,60%,60%)"},
{{0xd7, 0xd7, 0x87},
"186 LightGoldenrod2 #d7d787 rgb(215,215,135) hsl(60,50%,68%)"},
{{0xd7, 0xd7, 0xaf},
"187 LightYellow3 #d7d7af rgb(215,215,175) hsl(60,33%,76%)"},
{{0xd7, 0xd7, 0xd7},
"188 Grey84 #d7d7d7 rgb(215,215,215) hsl(0,0%,84%)"},
{{0xd7, 0xd7, 0xff},
"189 LightSteelBlue1 #d7d7ff rgb(215,215,255) hsl(240,100%,92%)"},
{{0xd7, 0xff, 0x00},
"190 Yellow2 #d7ff00 rgb(215,255,0) hsl(9,100%,50%)"},
{{0xd7, 0xff, 0x5f},
"191 DarkOliveGreen1 #d7ff5f rgb(215,255,95) hsl(75,100%,68%)"},
{{0xd7, 0xff, 0x87},
"192 DarkOliveGreen1 #d7ff87 rgb(215,255,135) hsl(80,100%,76%)"},
{{0xd7, 0xff, 0xaf},
"193 DarkSeaGreen1 #d7ffaf rgb(215,255,175) hsl(90,100%,84%)"},
{{0xd7, 0xff, 0xd7},
"194 Honeydew2 #d7ffd7 rgb(215,255,215) hsl(120,100%,92%)"},
{{0xd7, 0xff, 0xff},
"195 LightCyan1 #d7ffff rgb(215,255,255) hsl(180,100%,92%)"},
{{0xff, 0x00, 0x00},
"196 Red1 #ff0000 rgb(255,0,0) hsl(0,100%,50%)"},
{{0xff, 0x00, 0x5f},
"197 DeepPink2 #ff005f rgb(255,0,95) hsl(37,100%,50%)"},
{{0xff, 0x00, 0x87},
"198 DeepPink1 #ff0087 rgb(255,0,135) hsl(28,100%,50%)"},
{{0xff, 0x00, 0xaf},
"199 DeepPink1 #ff00af rgb(255,0,175) hsl(18,100%,50%)"},
{{0xff, 0x00, 0xd7},
"200 Magenta2 #ff00d7 rgb(255,0,215) hsl(09,100%,50%)"},
{{0xff, 0x00, 0xff},
"201 Magenta1 #ff00ff rgb(255,0,255) hsl(300,100%,50%)"},
{{0xff, 0x5f, 0x00},
"202 OrangeRed1 #ff5f00 rgb(255,95,0) hsl(2,100%,50%)"},
{{0xff, 0x5f, 0x5f},
"203 IndianRed1 #ff5f5f rgb(255,95,95) hsl(0,100%,68%)"},
{{0xff, 0x5f, 0x87},
"204 IndianRed1 #ff5f87 rgb(255,95,135) hsl(345,100%,68%)"},
{{0xff, 0x5f, 0xaf},
"205 HotPink #ff5faf rgb(255,95,175) hsl(330,100%,68%)"},
{{0xff, 0x5f, 0xd7},
"206 HotPink #ff5fd7 rgb(255,95,215) hsl(315,100%,68%)"},
{{0xff, 0x5f, 0xff},
"207 MediumOrchid1 #ff5fff rgb(255,95,255) hsl(300,100%,68%)"},
{{0xff, 0x87, 0x00},
"208 DarkOrange #ff8700 rgb(255,135,0) hsl(1,100%,50%)"},
{{0xff, 0x87, 0x5f},
"209 Salmon1 #ff875f rgb(255,135,95) hsl(15,100%,68%)"},
{{0xff, 0x87, 0x87},
"210 LightCoral #ff8787 rgb(255,135,135) hsl(0,100%,76%)"},
{{0xff, 0x87, 0xaf},
"211 PaleVioletRed1 #ff87af rgb(255,135,175) hsl(340,100%,76%)"},
{{0xff, 0x87, 0xd7},
"212 Orchid2 #ff87d7 rgb(255,135,215) hsl(320,100%,76%)"},
{{0xff, 0x87, 0xff},
"213 Orchid1 #ff87ff rgb(255,135,255) hsl(300,100%,76%)"},
{{0xff, 0xaf, 0x00},
"214 Orange1 #ffaf00 rgb(255,175,0) hsl(1,100%,50%)"},
{{0xff, 0xaf, 0x5f},
"215 SandyBrown #ffaf5f rgb(255,175,95) hsl(30,100%,68%)"},
{{0xff, 0xaf, 0x87},
"216 LightSalmon1 #ffaf87 rgb(255,175,135) hsl(20,100%,76%)"},
{{0xff, 0xaf, 0xaf},
"217 LightPink1 #ffafaf rgb(255,175,175) hsl(0,100%,84%)"},
{{0xff, 0xaf, 0xd7},
"218 Pink1 #ffafd7 rgb(255,175,215) hsl(330,100%,84%)"},
{{0xff, 0xaf, 0xff},
"219 Plum1 #ffafff rgb(255,175,255) hsl(300,100%,84%)"},
{{0xff, 0xd7, 0x00},
"220 Gold1 #ffd700 rgb(255,215,0) hsl(0,100%,50%)"},
{{0xff, 0xd7, 0x5f},
"221 LightGoldenrod2 #ffd75f rgb(255,215,95) hsl(45,100%,68%)"},
{{0xff, 0xd7, 0x87},
"222 LightGoldenrod2 #ffd787 rgb(255,215,135) hsl(40,100%,76%)"},
{{0xff, 0xd7, 0xaf},
"223 NavajoWhite1 #ffd7af rgb(255,215,175) hsl(30,100%,84%)"},
{{0xff, 0xd7, 0xd7},
"224 MistyRose1 #ffd7d7 rgb(255,215,215) hsl(0,100%,92%)"},
{{0xff, 0xd7, 0xff},
"225 Thistle1 #ffd7ff rgb(255,215,255) hsl(300,100%,92%)"},
{{0xff, 0xff, 0x00},
"226 Yellow1 #ffff00 rgb(255,255,0) hsl(60,100%,50%)"},
{{0xff, 0xff, 0x5f},
"227 LightGoldenrod1 #ffff5f rgb(255,255,95) hsl(60,100%,68%)"},
{{0xff, 0xff, 0x87},
"228 Khaki1 #ffff87 rgb(255,255,135) hsl(60,100%,76%)"},
{{0xff, 0xff, 0xaf},
"229 Wheat1 #ffffaf rgb(255,255,175) hsl(60,100%,84%)"},
{{0xff, 0xff, 0xd7},
"230 Cornsilk1 #ffffd7 rgb(255,255,215) hsl(60,100%,92%)"},
{{0xff, 0xff, 0xff},
"231 Grey100 #ffffff rgb(255,255,255) hsl(0,0%,100%)"},
{{0x08, 0x08, 0x08},
"232 Grey3 #080808 rgb(8,8,8) hsl(0,0%,3%)"},
{{0x12, 0x12, 0x12},
"233 Grey7 #121212 rgb(18,18,18) hsl(0,0%,7%)"},
{{0x1c, 0x1c, 0x1c},
"234 Grey11 #1c1c1c rgb(28,28,28) hsl(0,0%,10%)"},
{{0x26, 0x26, 0x26},
"235 Grey15 #262626 rgb(38,38,38) hsl(0,0%,14%)"},
{{0x30, 0x30, 0x30},
"236 Grey19 #303030 rgb(48,48,48) hsl(0,0%,18%)"},
{{0x3a, 0x3a, 0x3a},
"237 Grey23 #3a3a3a rgb(58,58,58) hsl(0,0%,22%)"},
{{0x44, 0x44, 0x44},
"238 Grey27 #444444 rgb(68,68,68) hsl(0,0%,26%)"},
{{0x4e, 0x4e, 0x4e},
"239 Grey30 #4e4e4e rgb(78,78,78) hsl(0,0%,30%)"},
{{0x58, 0x58, 0x58},
"240 Grey35 #585858 rgb(88,88,88) hsl(0,0%,34%)"},
{{0x62, 0x62, 0x62},
"241 Grey39 #626262 rgb(98,98,98) hsl(0,0%,37%)"},
{{0x6c, 0x6c, 0x6c},
"242 Grey42 #6c6c6c rgb(108,108,108) hsl(0,0%,40%)"},
{{0x76, 0x76, 0x76},
"243 Grey46 #767676 rgb(118,118,118) hsl(0,0%,46%)"},
{{0x80, 0x80, 0x80},
"244 Grey50 #808080 rgb(128,128,128) hsl(0,0%,50%)"},
{{0x8a, 0x8a, 0x8a},
"245 Grey54 #8a8a8a rgb(138,138,138) hsl(0,0%,54%)"},
{{0x94, 0x94, 0x94},
"246 Grey58 #949494 rgb(148,148,148) hsl(0,0%,58%)"},
{{0x9e, 0x9e, 0x9e},
"247 Grey62 #9e9e9e rgb(158,158,158) hsl(0,0%,61%)"},
{{0xa8, 0xa8, 0xa8},
"248 Grey66 #a8a8a8 rgb(168,168,168) hsl(0,0%,65%)"},
{{0xb2, 0xb2, 0xb2},
"249 Grey70 #b2b2b2 rgb(178,178,178) hsl(0,0%,69%)"},
{{0xbc, 0xbc, 0xbc},
"250 Grey74 #bcbcbc rgb(188,188,188) hsl(0,0%,73%)"},
{{0xc6, 0xc6, 0xc6},
"251 Grey78 #c6c6c6 rgb(198,198,198) hsl(0,0%,77%)"},
{{0xd0, 0xd0, 0xd0},
"252 Grey82 #d0d0d0 rgb(208,208,208) hsl(0,0%,81%)"},
{{0xda, 0xda, 0xda},
"253 Grey85 #dadada rgb(218,218,218) hsl(0,0%,85%)"},
{{0xe4, 0xe4, 0xe4},
"254 Grey89 #e4e4e4 rgb(228,228,228) hsl(0,0%,89%)"},
{{0xee, 0xee, 0xee},
"255 Grey93 #eeeeee rgb(238,238,238) hsl(0,0%,93%)"},
};
int main(int argc, char *argv[]) {
size_t i;
printf("BG FG BB BF XTERM NAME HEX RGB HSL\n");
for (i = 0; i < 256; ++i) {
printf("\e[48;5;%dm \e[0m \e[38;5;%dm██\e[0m \e[1;48;5;%dm "
"\e[0m \e[1;38;5;%dm██\e[0m %-6hhu%-18s#%02hhu%02hhu%02hhu\n",
i, i, i, i, i, kXtermName[i]);
}
return 0;
}