github.com/gagliardetto/solana-go@v1.11.0/text/codes.go (about) 1 package text 2 3 // This code is a modified version of the rgbterm package: 4 // see https://github.com/aybabtme/rgbterm/blob/master/LICENSE 5 // Original license: 6 // 7 // The MIT License 8 9 // Copyright (c) 2014, Antoine Grondin. 10 11 // Permission is hereby granted, free of charge, to any person obtaining a copy 12 // of this software and associated documentation files (the "Software"), to deal 13 // in the Software without restriction, including without limitation the rights 14 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 15 // copies of the Software, and to permit persons to whom the Software is 16 // furnished to do so, subject to the following conditions: 17 18 // The above copyright notice and this permission notice shall be included in 19 // all copies or substantial portions of the Software. 20 21 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 22 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 23 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 24 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 25 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 26 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 27 // THE SOFTWARE. 28 29 // > Except for functions HSLtoRGB and RGBtoHSL, under a BSD 2 clause license: 30 31 // Copyright (c) 2012 Rodrigo Moraes. All rights reserved. 32 33 // Redistribution and use in source and binary forms, with or without 34 // modification, are permitted provided that the following conditions are 35 // met: 36 37 // * Redistributions of source code must retain the above copyright 38 // notice, this list of conditions and the following disclaimer. 39 // * Redistributions in binary form must reproduce the above 40 // copyright notice, this list of conditions and the following disclaimer 41 // in the documentation and/or other materials provided with the 42 // distribution. 43 // * Neither the name of Google Inc. nor the names of its 44 // contributors may be used to endorse or promote products derived from 45 // this software without specific prior written permission. 46 47 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 48 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 49 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 50 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 51 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 52 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 53 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 54 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 55 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 56 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 57 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 58 59 // \033[ 60 61 var fgTermRGB = [...][]byte{ 62 []byte("38;5;0"), 63 []byte("38;5;1"), 64 []byte("38;5;2"), 65 []byte("38;5;3"), 66 []byte("38;5;4"), 67 []byte("38;5;5"), 68 []byte("38;5;6"), 69 []byte("38;5;7"), 70 []byte("38;5;8"), 71 []byte("38;5;9"), 72 []byte("38;5;10"), 73 []byte("38;5;11"), 74 []byte("38;5;12"), 75 []byte("38;5;13"), 76 []byte("38;5;14"), 77 []byte("38;5;15"), 78 []byte("38;5;16"), 79 []byte("38;5;17"), 80 []byte("38;5;18"), 81 []byte("38;5;19"), 82 []byte("38;5;20"), 83 []byte("38;5;21"), 84 []byte("38;5;22"), 85 []byte("38;5;23"), 86 []byte("38;5;24"), 87 []byte("38;5;25"), 88 []byte("38;5;26"), 89 []byte("38;5;27"), 90 []byte("38;5;28"), 91 []byte("38;5;29"), 92 []byte("38;5;30"), 93 []byte("38;5;31"), 94 []byte("38;5;32"), 95 []byte("38;5;33"), 96 []byte("38;5;34"), 97 []byte("38;5;35"), 98 []byte("38;5;36"), 99 []byte("38;5;37"), 100 []byte("38;5;38"), 101 []byte("38;5;39"), 102 []byte("38;5;40"), 103 []byte("38;5;41"), 104 []byte("38;5;42"), 105 []byte("38;5;43"), 106 []byte("38;5;44"), 107 []byte("38;5;45"), 108 []byte("38;5;46"), 109 []byte("38;5;47"), 110 []byte("38;5;48"), 111 []byte("38;5;49"), 112 []byte("38;5;50"), 113 []byte("38;5;51"), 114 []byte("38;5;52"), 115 []byte("38;5;53"), 116 []byte("38;5;54"), 117 []byte("38;5;55"), 118 []byte("38;5;56"), 119 []byte("38;5;57"), 120 []byte("38;5;58"), 121 []byte("38;5;59"), 122 []byte("38;5;60"), 123 []byte("38;5;61"), 124 []byte("38;5;62"), 125 []byte("38;5;63"), 126 []byte("38;5;64"), 127 []byte("38;5;65"), 128 []byte("38;5;66"), 129 []byte("38;5;67"), 130 []byte("38;5;68"), 131 []byte("38;5;69"), 132 []byte("38;5;70"), 133 []byte("38;5;71"), 134 []byte("38;5;72"), 135 []byte("38;5;73"), 136 []byte("38;5;74"), 137 []byte("38;5;75"), 138 []byte("38;5;76"), 139 []byte("38;5;77"), 140 []byte("38;5;78"), 141 []byte("38;5;79"), 142 []byte("38;5;80"), 143 []byte("38;5;81"), 144 []byte("38;5;82"), 145 []byte("38;5;83"), 146 []byte("38;5;84"), 147 []byte("38;5;85"), 148 []byte("38;5;86"), 149 []byte("38;5;87"), 150 []byte("38;5;88"), 151 []byte("38;5;89"), 152 []byte("38;5;90"), 153 []byte("38;5;91"), 154 []byte("38;5;92"), 155 []byte("38;5;93"), 156 []byte("38;5;94"), 157 []byte("38;5;95"), 158 []byte("38;5;96"), 159 []byte("38;5;97"), 160 []byte("38;5;98"), 161 []byte("38;5;99"), 162 []byte("38;5;100"), 163 []byte("38;5;101"), 164 []byte("38;5;102"), 165 []byte("38;5;103"), 166 []byte("38;5;104"), 167 []byte("38;5;105"), 168 []byte("38;5;106"), 169 []byte("38;5;107"), 170 []byte("38;5;108"), 171 []byte("38;5;109"), 172 []byte("38;5;110"), 173 []byte("38;5;111"), 174 []byte("38;5;112"), 175 []byte("38;5;113"), 176 []byte("38;5;114"), 177 []byte("38;5;115"), 178 []byte("38;5;116"), 179 []byte("38;5;117"), 180 []byte("38;5;118"), 181 []byte("38;5;119"), 182 []byte("38;5;120"), 183 []byte("38;5;121"), 184 []byte("38;5;122"), 185 []byte("38;5;123"), 186 []byte("38;5;124"), 187 []byte("38;5;125"), 188 []byte("38;5;126"), 189 []byte("38;5;127"), 190 []byte("38;5;128"), 191 []byte("38;5;129"), 192 []byte("38;5;130"), 193 []byte("38;5;131"), 194 []byte("38;5;132"), 195 []byte("38;5;133"), 196 []byte("38;5;134"), 197 []byte("38;5;135"), 198 []byte("38;5;136"), 199 []byte("38;5;137"), 200 []byte("38;5;138"), 201 []byte("38;5;139"), 202 []byte("38;5;140"), 203 []byte("38;5;141"), 204 []byte("38;5;142"), 205 []byte("38;5;143"), 206 []byte("38;5;144"), 207 []byte("38;5;145"), 208 []byte("38;5;146"), 209 []byte("38;5;147"), 210 []byte("38;5;148"), 211 []byte("38;5;149"), 212 []byte("38;5;150"), 213 []byte("38;5;151"), 214 []byte("38;5;152"), 215 []byte("38;5;153"), 216 []byte("38;5;154"), 217 []byte("38;5;155"), 218 []byte("38;5;156"), 219 []byte("38;5;157"), 220 []byte("38;5;158"), 221 []byte("38;5;159"), 222 []byte("38;5;160"), 223 []byte("38;5;161"), 224 []byte("38;5;162"), 225 []byte("38;5;163"), 226 []byte("38;5;164"), 227 []byte("38;5;165"), 228 []byte("38;5;166"), 229 []byte("38;5;167"), 230 []byte("38;5;168"), 231 []byte("38;5;169"), 232 []byte("38;5;170"), 233 []byte("38;5;171"), 234 []byte("38;5;172"), 235 []byte("38;5;173"), 236 []byte("38;5;174"), 237 []byte("38;5;175"), 238 []byte("38;5;176"), 239 []byte("38;5;177"), 240 []byte("38;5;178"), 241 []byte("38;5;179"), 242 []byte("38;5;180"), 243 []byte("38;5;181"), 244 []byte("38;5;182"), 245 []byte("38;5;183"), 246 []byte("38;5;184"), 247 []byte("38;5;185"), 248 []byte("38;5;186"), 249 []byte("38;5;187"), 250 []byte("38;5;188"), 251 []byte("38;5;189"), 252 []byte("38;5;190"), 253 []byte("38;5;191"), 254 []byte("38;5;192"), 255 []byte("38;5;193"), 256 []byte("38;5;194"), 257 []byte("38;5;195"), 258 []byte("38;5;196"), 259 []byte("38;5;197"), 260 []byte("38;5;198"), 261 []byte("38;5;199"), 262 []byte("38;5;200"), 263 []byte("38;5;201"), 264 []byte("38;5;202"), 265 []byte("38;5;203"), 266 []byte("38;5;204"), 267 []byte("38;5;205"), 268 []byte("38;5;206"), 269 []byte("38;5;207"), 270 []byte("38;5;208"), 271 []byte("38;5;209"), 272 []byte("38;5;210"), 273 []byte("38;5;211"), 274 []byte("38;5;212"), 275 []byte("38;5;213"), 276 []byte("38;5;214"), 277 []byte("38;5;215"), 278 []byte("38;5;216"), 279 []byte("38;5;217"), 280 []byte("38;5;218"), 281 []byte("38;5;219"), 282 []byte("38;5;220"), 283 []byte("38;5;221"), 284 []byte("38;5;222"), 285 []byte("38;5;223"), 286 []byte("38;5;224"), 287 []byte("38;5;225"), 288 []byte("38;5;226"), 289 []byte("38;5;227"), 290 []byte("38;5;228"), 291 []byte("38;5;229"), 292 []byte("38;5;230"), 293 []byte("38;5;231"), 294 []byte("38;5;232"), 295 []byte("38;5;233"), 296 []byte("38;5;234"), 297 []byte("38;5;235"), 298 []byte("38;5;236"), 299 []byte("38;5;237"), 300 []byte("38;5;238"), 301 []byte("38;5;239"), 302 []byte("38;5;240"), 303 []byte("38;5;241"), 304 []byte("38;5;242"), 305 []byte("38;5;243"), 306 []byte("38;5;244"), 307 []byte("38;5;245"), 308 []byte("38;5;246"), 309 []byte("38;5;247"), 310 []byte("38;5;248"), 311 []byte("38;5;249"), 312 []byte("38;5;250"), 313 []byte("38;5;251"), 314 []byte("38;5;252"), 315 []byte("38;5;253"), 316 []byte("38;5;254"), 317 []byte("38;5;255"), 318 } 319 320 var bgTermRGB = [...][]byte{ 321 []byte("48;5;0"), 322 []byte("48;5;1"), 323 []byte("48;5;2"), 324 []byte("48;5;3"), 325 []byte("48;5;4"), 326 []byte("48;5;5"), 327 []byte("48;5;6"), 328 []byte("48;5;7"), 329 []byte("48;5;8"), 330 []byte("48;5;9"), 331 []byte("48;5;10"), 332 []byte("48;5;11"), 333 []byte("48;5;12"), 334 []byte("48;5;13"), 335 []byte("48;5;14"), 336 []byte("48;5;15"), 337 []byte("48;5;16"), 338 []byte("48;5;17"), 339 []byte("48;5;18"), 340 []byte("48;5;19"), 341 []byte("48;5;20"), 342 []byte("48;5;21"), 343 []byte("48;5;22"), 344 []byte("48;5;23"), 345 []byte("48;5;24"), 346 []byte("48;5;25"), 347 []byte("48;5;26"), 348 []byte("48;5;27"), 349 []byte("48;5;28"), 350 []byte("48;5;29"), 351 []byte("48;5;30"), 352 []byte("48;5;31"), 353 []byte("48;5;32"), 354 []byte("48;5;33"), 355 []byte("48;5;34"), 356 []byte("48;5;35"), 357 []byte("48;5;36"), 358 []byte("48;5;37"), 359 []byte("48;5;38"), 360 []byte("48;5;39"), 361 []byte("48;5;40"), 362 []byte("48;5;41"), 363 []byte("48;5;42"), 364 []byte("48;5;43"), 365 []byte("48;5;44"), 366 []byte("48;5;45"), 367 []byte("48;5;46"), 368 []byte("48;5;47"), 369 []byte("48;5;48"), 370 []byte("48;5;49"), 371 []byte("48;5;50"), 372 []byte("48;5;51"), 373 []byte("48;5;52"), 374 []byte("48;5;53"), 375 []byte("48;5;54"), 376 []byte("48;5;55"), 377 []byte("48;5;56"), 378 []byte("48;5;57"), 379 []byte("48;5;58"), 380 []byte("48;5;59"), 381 []byte("48;5;60"), 382 []byte("48;5;61"), 383 []byte("48;5;62"), 384 []byte("48;5;63"), 385 []byte("48;5;64"), 386 []byte("48;5;65"), 387 []byte("48;5;66"), 388 []byte("48;5;67"), 389 []byte("48;5;68"), 390 []byte("48;5;69"), 391 []byte("48;5;70"), 392 []byte("48;5;71"), 393 []byte("48;5;72"), 394 []byte("48;5;73"), 395 []byte("48;5;74"), 396 []byte("48;5;75"), 397 []byte("48;5;76"), 398 []byte("48;5;77"), 399 []byte("48;5;78"), 400 []byte("48;5;79"), 401 []byte("48;5;80"), 402 []byte("48;5;81"), 403 []byte("48;5;82"), 404 []byte("48;5;83"), 405 []byte("48;5;84"), 406 []byte("48;5;85"), 407 []byte("48;5;86"), 408 []byte("48;5;87"), 409 []byte("48;5;88"), 410 []byte("48;5;89"), 411 []byte("48;5;90"), 412 []byte("48;5;91"), 413 []byte("48;5;92"), 414 []byte("48;5;93"), 415 []byte("48;5;94"), 416 []byte("48;5;95"), 417 []byte("48;5;96"), 418 []byte("48;5;97"), 419 []byte("48;5;98"), 420 []byte("48;5;99"), 421 []byte("48;5;100"), 422 []byte("48;5;101"), 423 []byte("48;5;102"), 424 []byte("48;5;103"), 425 []byte("48;5;104"), 426 []byte("48;5;105"), 427 []byte("48;5;106"), 428 []byte("48;5;107"), 429 []byte("48;5;108"), 430 []byte("48;5;109"), 431 []byte("48;5;110"), 432 []byte("48;5;111"), 433 []byte("48;5;112"), 434 []byte("48;5;113"), 435 []byte("48;5;114"), 436 []byte("48;5;115"), 437 []byte("48;5;116"), 438 []byte("48;5;117"), 439 []byte("48;5;118"), 440 []byte("48;5;119"), 441 []byte("48;5;120"), 442 []byte("48;5;121"), 443 []byte("48;5;122"), 444 []byte("48;5;123"), 445 []byte("48;5;124"), 446 []byte("48;5;125"), 447 []byte("48;5;126"), 448 []byte("48;5;127"), 449 []byte("48;5;128"), 450 []byte("48;5;129"), 451 []byte("48;5;130"), 452 []byte("48;5;131"), 453 []byte("48;5;132"), 454 []byte("48;5;133"), 455 []byte("48;5;134"), 456 []byte("48;5;135"), 457 []byte("48;5;136"), 458 []byte("48;5;137"), 459 []byte("48;5;138"), 460 []byte("48;5;139"), 461 []byte("48;5;140"), 462 []byte("48;5;141"), 463 []byte("48;5;142"), 464 []byte("48;5;143"), 465 []byte("48;5;144"), 466 []byte("48;5;145"), 467 []byte("48;5;146"), 468 []byte("48;5;147"), 469 []byte("48;5;148"), 470 []byte("48;5;149"), 471 []byte("48;5;150"), 472 []byte("48;5;151"), 473 []byte("48;5;152"), 474 []byte("48;5;153"), 475 []byte("48;5;154"), 476 []byte("48;5;155"), 477 []byte("48;5;156"), 478 []byte("48;5;157"), 479 []byte("48;5;158"), 480 []byte("48;5;159"), 481 []byte("48;5;160"), 482 []byte("48;5;161"), 483 []byte("48;5;162"), 484 []byte("48;5;163"), 485 []byte("48;5;164"), 486 []byte("48;5;165"), 487 []byte("48;5;166"), 488 []byte("48;5;167"), 489 []byte("48;5;168"), 490 []byte("48;5;169"), 491 []byte("48;5;170"), 492 []byte("48;5;171"), 493 []byte("48;5;172"), 494 []byte("48;5;173"), 495 []byte("48;5;174"), 496 []byte("48;5;175"), 497 []byte("48;5;176"), 498 []byte("48;5;177"), 499 []byte("48;5;178"), 500 []byte("48;5;179"), 501 []byte("48;5;180"), 502 []byte("48;5;181"), 503 []byte("48;5;182"), 504 []byte("48;5;183"), 505 []byte("48;5;184"), 506 []byte("48;5;185"), 507 []byte("48;5;186"), 508 []byte("48;5;187"), 509 []byte("48;5;188"), 510 []byte("48;5;189"), 511 []byte("48;5;190"), 512 []byte("48;5;191"), 513 []byte("48;5;192"), 514 []byte("48;5;193"), 515 []byte("48;5;194"), 516 []byte("48;5;195"), 517 []byte("48;5;196"), 518 []byte("48;5;197"), 519 []byte("48;5;198"), 520 []byte("48;5;199"), 521 []byte("48;5;200"), 522 []byte("48;5;201"), 523 []byte("48;5;202"), 524 []byte("48;5;203"), 525 []byte("48;5;204"), 526 []byte("48;5;205"), 527 []byte("48;5;206"), 528 []byte("48;5;207"), 529 []byte("48;5;208"), 530 []byte("48;5;209"), 531 []byte("48;5;210"), 532 []byte("48;5;211"), 533 []byte("48;5;212"), 534 []byte("48;5;213"), 535 []byte("48;5;214"), 536 []byte("48;5;215"), 537 []byte("48;5;216"), 538 []byte("48;5;217"), 539 []byte("48;5;218"), 540 []byte("48;5;219"), 541 []byte("48;5;220"), 542 []byte("48;5;221"), 543 []byte("48;5;222"), 544 []byte("48;5;223"), 545 []byte("48;5;224"), 546 []byte("48;5;225"), 547 []byte("48;5;226"), 548 []byte("48;5;227"), 549 []byte("48;5;228"), 550 []byte("48;5;229"), 551 []byte("48;5;230"), 552 []byte("48;5;231"), 553 []byte("48;5;232"), 554 []byte("48;5;233"), 555 []byte("48;5;234"), 556 []byte("48;5;235"), 557 []byte("48;5;236"), 558 []byte("48;5;237"), 559 []byte("48;5;238"), 560 []byte("48;5;239"), 561 []byte("48;5;240"), 562 []byte("48;5;241"), 563 []byte("48;5;242"), 564 []byte("48;5;243"), 565 []byte("48;5;244"), 566 []byte("48;5;245"), 567 []byte("48;5;246"), 568 []byte("48;5;247"), 569 []byte("48;5;248"), 570 []byte("48;5;249"), 571 []byte("48;5;250"), 572 []byte("48;5;251"), 573 []byte("48;5;252"), 574 []byte("48;5;253"), 575 []byte("48;5;254"), 576 []byte("48;5;255"), 577 }