text: COLOR_NAMES = {
      "black": 0,
      "maroon": 1,
      "green": 2,
      "olive": 3,
      "navy": 4,
      "teal": 6,
      "silver": 7,
      "grey": 8,
      "red": 9,
      "lime": 10,
      "yellow": 11,
      "blue": 12,
      "fuchsia": 13,
      "aqua": 14,
      "white": 15,
      "grey0": 16,
      "navyblue": 17,
      "darkblue": 18,
      "blue3": 20,
      "blue1": 21,
      "darkgreen": 22,
      "deepskyblue4": 25,
      "dodgerblue3": 26,
      "dodgerblue2": 27,
      "green4": 28,
      "springgreen4": 29,
      "turquoise4": 30,
      "deepskyblue3": 32,
      "dodgerblue1": 33,
      "darkcyan": 36,
      "lightseagreen": 37,
      "deepskyblue2": 38,
      "deepskyblue1": 39,
      "green3": 40,
      "springgreen3": 41,
      "cyan3": 43,
      "darkturquoise": 44,
      "turquoise2": 45,
      "green1": 46,
      "springgreen2": 47,
      "springgreen1": 48,
      "mediumspringgreen": 49,
      "cyan2": 50,
      "cyan1": 51,
      "purple4": 55,
      "purple3": 56,
      "blueviolet": 57,
      "grey37": 59,
      "mediumpurple4": 60,
      "slateblue3": 62,
      "royalblue1": 63,
      "chartreuse4": 64,
      "paleturquoise4": 66,
      "steelblue": 67,
      "steelblue3": 68,
      "cornflowerblue": 69,
      "darkseagreen4": 71,
      "cadetblue": 73,
      "skyblue3": 74,
      "chartreuse3": 76,
      "seagreen3": 78,
      "aquamarine3": 79,
      "mediumturquoise": 80,
      "steelblue1": 81,
      "seagreen2": 83,
      "seagreen1": 85,
      "darkslategray2": 87,
      "darkred": 88,
      "darkmagenta": 91,
      "orange4": 94,
      "lightpink4": 95,
      "plum4": 96,
      "mediumpurple3": 98,
      "slateblue1": 99,
      "wheat4": 101,
      "grey53": 102,
      "lightslategrey": 103,
      "mediumpurple": 104,
      "lightslateblue": 105,
      "yellow4": 106,
      "darkseagreen": 108,
      "lightskyblue3": 110,
      "skyblue2": 111,
      "chartreuse2": 112,
      "palegreen3": 114,
      "darkslategray3": 116,
      "skyblue1": 117,
      "chartreuse1": 118,
      "lightgreen": 120,
      "aquamarine1": 122,
      "darkslategray1": 123,
      "deeppink4": 125,
      "mediumvioletred": 126,
      "darkviolet": 128,
      "purple": 129,
      "mediumorchid3": 133,
      "mediumorchid": 134,
      "darkgoldenrod": 136,
      "rosybrown": 138,
      "grey63": 139,
      "mediumpurple2": 140,
      "mediumpurple1": 141,
      "darkkhaki": 143,
      "navajowhite3": 144,
      "grey69": 145,
      "lightsteelblue3": 146,
      "lightsteelblue": 147,
      "darkolivegreen3": 149,
      "darkseagreen3": 150,
      "lightcyan3": 152,
      "lightskyblue1": 153,
      "greenyellow": 154,
      "darkolivegreen2": 155,
      "palegreen1": 156,
      "darkseagreen2": 157,
      "paleturquoise1": 159,
      "red3": 160,
      "deeppink3": 162,
      "magenta3": 164,
      "darkorange3": 166,
      "indianred": 167,
      "hotpink3": 168,
      "hotpink2": 169,
      "orchid": 170,
      "orange3": 172,
      "lightsalmon3": 173,
      "lightpink3": 174,
      "pink3": 175,
      "plum3": 176,
      "violet": 177,
      "gold3": 178,
      "lightgoldenrod3": 179,
      "tan": 180,
      "mistyrose3": 181,
      "thistle3": 182,
      "plum2": 183,
      "yellow3": 184,
      "khaki3": 185,
      "lightyellow3": 187,
      "grey84": 188,
      "lightsteelblue1": 189,
      "yellow2": 190,
      "darkolivegreen1": 192,
      "darkseagreen1": 193,
      "honeydew2": 194,
      "lightcyan1": 195,
      "red1": 196,
      "deeppink2": 197,
      "deeppink1": 199,
      "magenta2": 200,
      "magenta1": 201,
      "orangered1": 202,
      "indianred1": 204,
      "hotpink": 206,
      "mediumorchid1": 207,
      "darkorange": 208,
      "salmon1": 209,
      "lightcoral": 210,
      "palevioletred1": 211,
      "orchid2": 212,
      "orchid1": 213,
      "orange1": 214,
      "sandybrown": 215,
      "lightsalmon1": 216,
      "lightpink1": 217,
      "pink1": 218,
      "plum1": 219,
      "gold1": 220,
      "lightgoldenrod2": 222,
      "navajowhite1": 223,
      "mistyrose1": 224,
      "thistle1": 225,
      "yellow1": 226,
      "lightgoldenrod1": 227,
      "khaki1": 228,
      "wheat1": 229,
      "cornsilk1": 230,
      "grey100": 231,
      "grey3": 232,
      "grey7": 233,
      "grey11": 234,
      "grey15": 235,
      "grey19": 236,
      "grey23": 237,
      "grey27": 238,
      "grey30": 239,
      "grey35": 240,
      "grey39": 241,
      "grey42": 242,
      "grey46": 243,
      "grey50": 244,
      "grey54": 245,
      "grey58": 246,
      "grey62": 247,
      "grey66": 248,
      "grey70": 249,
      "grey74": 250,
      "grey78": 251,
      "grey82": 252,
      "grey85": 253,
      "grey89": 254,
      "grey93": 255,
  }
  
  EIGHT_BIT_PALETTE = [
      (0, 0, 0),
      (128, 0, 0),
      (0, 128, 0),
      (128, 128, 0),
      (0, 0, 128),
      (128, 0, 128),
      (0, 128, 128),
      (192, 192, 192),
      (128, 128, 128),
      (255, 0, 0),
      (0, 255, 0),
      (255, 255, 0),
      (0, 0, 255),
      (255, 0, 255),
      (0, 255, 255),
      (255, 255, 255),
      (0, 0, 0),
      (0, 0, 95),
      (0, 0, 135),
      (0, 0, 175),
      (0, 0, 215),
      (0, 0, 255),
      (0, 95, 0),
      (0, 95, 95),
      (0, 95, 135),
      (0, 95, 175),
      (0, 95, 215),
      (0, 95, 255),
      (0, 135, 0),
      (0, 135, 95),
      (0, 135, 135),
      (0, 135, 175),
      (0, 135, 215),
      (0, 135, 255),
      (0, 175, 0),
      (0, 175, 95),
      (0, 175, 135),
      (0, 175, 175),
      (0, 175, 215),
      (0, 175, 255),
      (0, 215, 0),
      (0, 215, 95),
      (0, 215, 135),
      (0, 215, 175),
      (0, 215, 215),
      (0, 215, 255),
      (0, 255, 0),
      (0, 255, 95),
      (0, 255, 135),
      (0, 255, 175),
      (0, 255, 215),
      (0, 255, 255),
      (95, 0, 0),
      (95, 0, 95),
      (95, 0, 135),
      (95, 0, 175),
      (95, 0, 215),
      (95, 0, 255),
      (95, 95, 0),
      (95, 95, 95),
      (95, 95, 135),
      (95, 95, 175),
      (95, 95, 215),
      (95, 95, 255),
      (95, 135, 0),
      (95, 135, 95),
      (95, 135, 135),
      (95, 135, 175),
      (95, 135, 215),
      (95, 135, 255),
      (95, 175, 0),
      (95, 175, 95),
      (95, 175, 135),
      (95, 175, 175),
      (95, 175, 215),
      (95, 175, 255),
      (95, 215, 0),
      (95, 215, 95),
      (95, 215, 135),
      (95, 215, 175),
      (95, 215, 215),
      (95, 215, 255),
      (95, 255, 0),
      (95, 255, 95),
      (95, 255, 135),
      (95, 255, 175),
      (95, 255, 215),
      (95, 255, 255),
      (135, 0, 0),
      (135, 0, 95),
      (135, 0, 135),
      (135, 0, 175),
      (135, 0, 215),
      (135, 0, 255),
      (135, 95, 0),
      (135, 95, 95),
      (135, 95, 135),
      (135, 95, 175),
      (135, 95, 215),
      (135, 95, 255),
      (135, 135, 0),
      (135, 135, 95),
      (135, 135, 135),
      (135, 135, 175),
      (135, 135, 215),
      (135, 135, 255),
      (135, 175, 0),
      (135, 175, 95),
      (135, 175, 135),
      (135, 175, 175),
      (135, 175, 215),
      (135, 175, 255),
      (135, 215, 0),
      (135, 215, 95),
      (135, 215, 135),
      (135, 215, 175),
      (135, 215, 215),
      (135, 215, 255),
      (135, 255, 0),
      (135, 255, 95),
      (135, 255, 135),
      (135, 255, 175),
      (135, 255, 215),
      (135, 255, 255),
      (175, 0, 0),
      (175, 0, 95),
      (175, 0, 135),
      (175, 0, 175),
      (175, 0, 215),
      (175, 0, 255),
      (175, 95, 0),
      (175, 95, 95),
      (175, 95, 135),
      (175, 95, 175),
      (175, 95, 215),
      (175, 95, 255),
      (175, 135, 0),
      (175, 135, 95),
      (175, 135, 135),
      (175, 135, 175),
      (175, 135, 215),
      (175, 135, 255),
      (175, 175, 0),
      (175, 175, 95),
      (175, 175, 135),
      (175, 175, 175),
      (175, 175, 215),
      (175, 175, 255),
      (175, 215, 0),
      (175, 215, 95),
      (175, 215, 135),
      (175, 215, 175),
      (175, 215, 215),
      (175, 215, 255),
      (175, 255, 0),
      (175, 255, 95),
      (175, 255, 135),
      (175, 255, 175),
      (175, 255, 215),
      (175, 255, 255),
      (215, 0, 0),
      (215, 0, 95),
      (215, 0, 135),
      (215, 0, 175),
      (215, 0, 215),
      (215, 0, 255),
      (215, 95, 0),
      (215, 95, 95),
      (215, 95, 135),
      (215, 95, 175),
      (215, 95, 215),
      (215, 95, 255),
      (215, 135, 0),
      (215, 135, 95),
      (215, 135, 135),
      (215, 135, 175),
      (215, 135, 215),
      (215, 135, 255),
      (215, 175, 0),
      (215, 175, 95),
      (215, 175, 135),
      (215, 175, 175),
      (215, 175, 215),
      (215, 175, 255),
      (215, 215, 0),
      (215, 215, 95),
      (215, 215, 135),
      (215, 215, 175),
      (215, 215, 215),
      (215, 215, 255),
      (215, 255, 0),
      (215, 255, 95),
      (215, 255, 135),
      (215, 255, 175),
      (215, 255, 215),
      (215, 255, 255),
      (255, 0, 0),
      (255, 0, 95),
      (255, 0, 135),
      (255, 0, 175),
      (255, 0, 215),
      (255, 0, 255),
      (255, 95, 0),
      (255, 95, 95),
      (255, 95, 135),
      (255, 95, 175),
      (255, 95, 215),
      (255, 95, 255),
      (255, 135, 0),
      (255, 135, 95),
      (255, 135, 135),
      (255, 135, 175),
      (255, 135, 215),
      (255, 135, 255),
      (255, 175, 0),
      (255, 175, 95),
      (255, 175, 135),
      (255, 175, 175),
      (255, 175, 215),
      (255, 175, 255),
      (255, 215, 0),
      (255, 215, 95),
      (255, 215, 135),
      (255, 215, 175),
      (255, 215, 215),
      (255, 215, 255),
      (255, 255, 0),
      (255, 255, 95),
      (255, 255, 135),
      (255, 255, 175),
      (255, 255, 215),
      (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),
  ]
  