├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE.txt ├── README.md ├── img └── list.png ├── src ├── color.rs ├── lib.rs ├── main.rs └── provider.rs └── tests ├── color.rs └── fixtures ├── Dracula.itermcolors ├── Dracula.minttyrc ├── dracula.sh └── two-firewatch-light.itermcolors /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "RustyXML" 7 | version = "0.3.0" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "8b5ace29ee3216de37c0546865ad08edef58b0f9e76838ed8959a84a990e58c5" 10 | 11 | [[package]] 12 | name = "aead" 13 | version = "0.3.2" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" 16 | dependencies = [ 17 | "generic-array", 18 | ] 19 | 20 | [[package]] 21 | name = "aes" 22 | version = "0.6.0" 23 | source = "registry+https://github.com/rust-lang/crates.io-index" 24 | checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" 25 | dependencies = [ 26 | "aes-soft", 27 | "aesni", 28 | "cipher", 29 | ] 30 | 31 | [[package]] 32 | name = "aes-gcm" 33 | version = "0.8.0" 34 | source = "registry+https://github.com/rust-lang/crates.io-index" 35 | checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" 36 | dependencies = [ 37 | "aead", 38 | "aes", 39 | "cipher", 40 | "ctr", 41 | "ghash", 42 | "subtle", 43 | ] 44 | 45 | [[package]] 46 | name = "aes-soft" 47 | version = "0.6.4" 48 | source = "registry+https://github.com/rust-lang/crates.io-index" 49 | checksum = "be14c7498ea50828a38d0e24a765ed2effe92a705885b57d029cd67d45744072" 50 | dependencies = [ 51 | "cipher", 52 | "opaque-debug", 53 | ] 54 | 55 | [[package]] 56 | name = "aesni" 57 | version = "0.10.0" 58 | source = "registry+https://github.com/rust-lang/crates.io-index" 59 | checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" 60 | dependencies = [ 61 | "cipher", 62 | "opaque-debug", 63 | ] 64 | 65 | [[package]] 66 | name = "aho-corasick" 67 | version = "0.7.18" 68 | source = "registry+https://github.com/rust-lang/crates.io-index" 69 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 70 | dependencies = [ 71 | "memchr", 72 | ] 73 | 74 | [[package]] 75 | name = "anyhow" 76 | version = "1.0.57" 77 | source = "registry+https://github.com/rust-lang/crates.io-index" 78 | checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" 79 | 80 | [[package]] 81 | name = "async-attributes" 82 | version = "1.1.2" 83 | source = "registry+https://github.com/rust-lang/crates.io-index" 84 | checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" 85 | dependencies = [ 86 | "quote", 87 | "syn", 88 | ] 89 | 90 | [[package]] 91 | name = "async-channel" 92 | version = "1.6.1" 93 | source = "registry+https://github.com/rust-lang/crates.io-index" 94 | checksum = "2114d64672151c0c5eaa5e131ec84a74f06e1e559830dabba01ca30605d66319" 95 | dependencies = [ 96 | "concurrent-queue", 97 | "event-listener", 98 | "futures-core", 99 | ] 100 | 101 | [[package]] 102 | name = "async-executor" 103 | version = "1.4.1" 104 | source = "registry+https://github.com/rust-lang/crates.io-index" 105 | checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" 106 | dependencies = [ 107 | "async-task", 108 | "concurrent-queue", 109 | "fastrand", 110 | "futures-lite", 111 | "once_cell", 112 | "slab", 113 | ] 114 | 115 | [[package]] 116 | name = "async-global-executor" 117 | version = "2.1.0" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "fd8b508d585e01084059b60f06ade4cb7415cd2e4084b71dd1cb44e7d3fb9880" 120 | dependencies = [ 121 | "async-channel", 122 | "async-executor", 123 | "async-io", 124 | "async-lock", 125 | "blocking", 126 | "futures-lite", 127 | "once_cell", 128 | ] 129 | 130 | [[package]] 131 | name = "async-io" 132 | version = "1.7.0" 133 | source = "registry+https://github.com/rust-lang/crates.io-index" 134 | checksum = "e5e18f61464ae81cde0a23e713ae8fd299580c54d697a35820cfd0625b8b0e07" 135 | dependencies = [ 136 | "concurrent-queue", 137 | "futures-lite", 138 | "libc", 139 | "log", 140 | "once_cell", 141 | "parking", 142 | "polling", 143 | "slab", 144 | "socket2", 145 | "waker-fn", 146 | "winapi", 147 | ] 148 | 149 | [[package]] 150 | name = "async-lock" 151 | version = "2.5.0" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "e97a171d191782fba31bb902b14ad94e24a68145032b7eedf871ab0bc0d077b6" 154 | dependencies = [ 155 | "event-listener", 156 | ] 157 | 158 | [[package]] 159 | name = "async-std" 160 | version = "1.11.0" 161 | source = "registry+https://github.com/rust-lang/crates.io-index" 162 | checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" 163 | dependencies = [ 164 | "async-attributes", 165 | "async-channel", 166 | "async-global-executor", 167 | "async-io", 168 | "async-lock", 169 | "crossbeam-utils", 170 | "futures-channel", 171 | "futures-core", 172 | "futures-io", 173 | "futures-lite", 174 | "gloo-timers", 175 | "kv-log-macro", 176 | "log", 177 | "memchr", 178 | "num_cpus", 179 | "once_cell", 180 | "pin-project-lite", 181 | "pin-utils", 182 | "slab", 183 | "wasm-bindgen-futures", 184 | ] 185 | 186 | [[package]] 187 | name = "async-task" 188 | version = "4.2.0" 189 | source = "registry+https://github.com/rust-lang/crates.io-index" 190 | checksum = "30696a84d817107fc028e049980e09d5e140e8da8f1caeb17e8e950658a3cea9" 191 | 192 | [[package]] 193 | name = "async-trait" 194 | version = "0.1.56" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" 197 | dependencies = [ 198 | "proc-macro2", 199 | "quote", 200 | "syn", 201 | ] 202 | 203 | [[package]] 204 | name = "atomic-waker" 205 | version = "1.0.0" 206 | source = "registry+https://github.com/rust-lang/crates.io-index" 207 | checksum = "065374052e7df7ee4047b1160cca5e1467a12351a40b3da123c870ba0b8eda2a" 208 | 209 | [[package]] 210 | name = "autocfg" 211 | version = "1.1.0" 212 | source = "registry+https://github.com/rust-lang/crates.io-index" 213 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 214 | 215 | [[package]] 216 | name = "base-x" 217 | version = "0.2.10" 218 | source = "registry+https://github.com/rust-lang/crates.io-index" 219 | checksum = "dc19a4937b4fbd3fe3379793130e42060d10627a360f2127802b10b87e7baf74" 220 | 221 | [[package]] 222 | name = "base64" 223 | version = "0.13.0" 224 | source = "registry+https://github.com/rust-lang/crates.io-index" 225 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 226 | 227 | [[package]] 228 | name = "bitflags" 229 | version = "1.3.2" 230 | source = "registry+https://github.com/rust-lang/crates.io-index" 231 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 232 | 233 | [[package]] 234 | name = "block-buffer" 235 | version = "0.9.0" 236 | source = "registry+https://github.com/rust-lang/crates.io-index" 237 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 238 | dependencies = [ 239 | "generic-array", 240 | ] 241 | 242 | [[package]] 243 | name = "blocking" 244 | version = "1.2.0" 245 | source = "registry+https://github.com/rust-lang/crates.io-index" 246 | checksum = "c6ccb65d468978a086b69884437ded69a90faab3bbe6e67f242173ea728acccc" 247 | dependencies = [ 248 | "async-channel", 249 | "async-task", 250 | "atomic-waker", 251 | "fastrand", 252 | "futures-lite", 253 | "once_cell", 254 | ] 255 | 256 | [[package]] 257 | name = "bumpalo" 258 | version = "3.10.0" 259 | source = "registry+https://github.com/rust-lang/crates.io-index" 260 | checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" 261 | 262 | [[package]] 263 | name = "bytes" 264 | version = "0.5.6" 265 | source = "registry+https://github.com/rust-lang/crates.io-index" 266 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 267 | 268 | [[package]] 269 | name = "bytes" 270 | version = "1.1.0" 271 | source = "registry+https://github.com/rust-lang/crates.io-index" 272 | checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" 273 | 274 | [[package]] 275 | name = "cache-padded" 276 | version = "1.2.0" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" 279 | 280 | [[package]] 281 | name = "cc" 282 | version = "1.0.73" 283 | source = "registry+https://github.com/rust-lang/crates.io-index" 284 | checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" 285 | 286 | [[package]] 287 | name = "cfg-if" 288 | version = "1.0.0" 289 | source = "registry+https://github.com/rust-lang/crates.io-index" 290 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 291 | 292 | [[package]] 293 | name = "cipher" 294 | version = "0.2.5" 295 | source = "registry+https://github.com/rust-lang/crates.io-index" 296 | checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" 297 | dependencies = [ 298 | "generic-array", 299 | ] 300 | 301 | [[package]] 302 | name = "colortty" 303 | version = "0.2.5" 304 | dependencies = [ 305 | "RustyXML", 306 | "anyhow", 307 | "async-std", 308 | "dirs", 309 | "futures", 310 | "getopts", 311 | "json", 312 | "regex", 313 | "surf", 314 | "thiserror", 315 | ] 316 | 317 | [[package]] 318 | name = "concurrent-queue" 319 | version = "1.2.2" 320 | source = "registry+https://github.com/rust-lang/crates.io-index" 321 | checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" 322 | dependencies = [ 323 | "cache-padded", 324 | ] 325 | 326 | [[package]] 327 | name = "const_fn" 328 | version = "0.4.9" 329 | source = "registry+https://github.com/rust-lang/crates.io-index" 330 | checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" 331 | 332 | [[package]] 333 | name = "cookie" 334 | version = "0.14.4" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "03a5d7b21829bc7b4bf4754a978a241ae54ea55a40f92bb20216e54096f4b951" 337 | dependencies = [ 338 | "aes-gcm", 339 | "base64", 340 | "hkdf", 341 | "hmac", 342 | "percent-encoding", 343 | "rand 0.8.5", 344 | "sha2", 345 | "time", 346 | "version_check", 347 | ] 348 | 349 | [[package]] 350 | name = "cpufeatures" 351 | version = "0.2.2" 352 | source = "registry+https://github.com/rust-lang/crates.io-index" 353 | checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" 354 | dependencies = [ 355 | "libc", 356 | ] 357 | 358 | [[package]] 359 | name = "cpuid-bool" 360 | version = "0.2.0" 361 | source = "registry+https://github.com/rust-lang/crates.io-index" 362 | checksum = "dcb25d077389e53838a8158c8e99174c5a9d902dee4904320db714f3c653ffba" 363 | 364 | [[package]] 365 | name = "crossbeam-utils" 366 | version = "0.8.9" 367 | source = "registry+https://github.com/rust-lang/crates.io-index" 368 | checksum = "8ff1f980957787286a554052d03c7aee98d99cc32e09f6d45f0a814133c87978" 369 | dependencies = [ 370 | "cfg-if", 371 | "once_cell", 372 | ] 373 | 374 | [[package]] 375 | name = "crypto-mac" 376 | version = "0.10.1" 377 | source = "registry+https://github.com/rust-lang/crates.io-index" 378 | checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a" 379 | dependencies = [ 380 | "generic-array", 381 | "subtle", 382 | ] 383 | 384 | [[package]] 385 | name = "ctor" 386 | version = "0.1.22" 387 | source = "registry+https://github.com/rust-lang/crates.io-index" 388 | checksum = "f877be4f7c9f246b183111634f75baa039715e3f46ce860677d3b19a69fb229c" 389 | dependencies = [ 390 | "quote", 391 | "syn", 392 | ] 393 | 394 | [[package]] 395 | name = "ctr" 396 | version = "0.6.0" 397 | source = "registry+https://github.com/rust-lang/crates.io-index" 398 | checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" 399 | dependencies = [ 400 | "cipher", 401 | ] 402 | 403 | [[package]] 404 | name = "curl" 405 | version = "0.4.43" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "37d855aeef205b43f65a5001e0997d81f8efca7badad4fad7d897aa7f0d0651f" 408 | dependencies = [ 409 | "curl-sys", 410 | "libc", 411 | "openssl-probe", 412 | "openssl-sys", 413 | "schannel", 414 | "socket2", 415 | "winapi", 416 | ] 417 | 418 | [[package]] 419 | name = "curl-sys" 420 | version = "0.4.55+curl-7.83.1" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "23734ec77368ec583c2e61dd3f0b0e5c98b93abe6d2a004ca06b91dd7e3e2762" 423 | dependencies = [ 424 | "cc", 425 | "libc", 426 | "libnghttp2-sys", 427 | "libz-sys", 428 | "openssl-sys", 429 | "pkg-config", 430 | "vcpkg", 431 | "winapi", 432 | ] 433 | 434 | [[package]] 435 | name = "digest" 436 | version = "0.9.0" 437 | source = "registry+https://github.com/rust-lang/crates.io-index" 438 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 439 | dependencies = [ 440 | "generic-array", 441 | ] 442 | 443 | [[package]] 444 | name = "dirs" 445 | version = "4.0.0" 446 | source = "registry+https://github.com/rust-lang/crates.io-index" 447 | checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" 448 | dependencies = [ 449 | "dirs-sys", 450 | ] 451 | 452 | [[package]] 453 | name = "dirs-sys" 454 | version = "0.3.7" 455 | source = "registry+https://github.com/rust-lang/crates.io-index" 456 | checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" 457 | dependencies = [ 458 | "libc", 459 | "redox_users", 460 | "winapi", 461 | ] 462 | 463 | [[package]] 464 | name = "discard" 465 | version = "1.0.4" 466 | source = "registry+https://github.com/rust-lang/crates.io-index" 467 | checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" 468 | 469 | [[package]] 470 | name = "encoding_rs" 471 | version = "0.8.31" 472 | source = "registry+https://github.com/rust-lang/crates.io-index" 473 | checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" 474 | dependencies = [ 475 | "cfg-if", 476 | ] 477 | 478 | [[package]] 479 | name = "event-listener" 480 | version = "2.5.2" 481 | source = "registry+https://github.com/rust-lang/crates.io-index" 482 | checksum = "77f3309417938f28bf8228fcff79a4a37103981e3e186d2ccd19c74b38f4eb71" 483 | 484 | [[package]] 485 | name = "fastrand" 486 | version = "1.7.0" 487 | source = "registry+https://github.com/rust-lang/crates.io-index" 488 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 489 | dependencies = [ 490 | "instant", 491 | ] 492 | 493 | [[package]] 494 | name = "flume" 495 | version = "0.9.2" 496 | source = "registry+https://github.com/rust-lang/crates.io-index" 497 | checksum = "1bebadab126f8120d410b677ed95eee4ba6eb7c6dd8e34a5ec88a08050e26132" 498 | dependencies = [ 499 | "futures-core", 500 | "futures-sink", 501 | "spinning_top", 502 | ] 503 | 504 | [[package]] 505 | name = "fnv" 506 | version = "1.0.7" 507 | source = "registry+https://github.com/rust-lang/crates.io-index" 508 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 509 | 510 | [[package]] 511 | name = "form_urlencoded" 512 | version = "1.0.1" 513 | source = "registry+https://github.com/rust-lang/crates.io-index" 514 | checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" 515 | dependencies = [ 516 | "matches", 517 | "percent-encoding", 518 | ] 519 | 520 | [[package]] 521 | name = "futures" 522 | version = "0.3.21" 523 | source = "registry+https://github.com/rust-lang/crates.io-index" 524 | checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" 525 | dependencies = [ 526 | "futures-channel", 527 | "futures-core", 528 | "futures-executor", 529 | "futures-io", 530 | "futures-sink", 531 | "futures-task", 532 | "futures-util", 533 | ] 534 | 535 | [[package]] 536 | name = "futures-channel" 537 | version = "0.3.21" 538 | source = "registry+https://github.com/rust-lang/crates.io-index" 539 | checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" 540 | dependencies = [ 541 | "futures-core", 542 | "futures-sink", 543 | ] 544 | 545 | [[package]] 546 | name = "futures-core" 547 | version = "0.3.21" 548 | source = "registry+https://github.com/rust-lang/crates.io-index" 549 | checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" 550 | 551 | [[package]] 552 | name = "futures-executor" 553 | version = "0.3.21" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" 556 | dependencies = [ 557 | "futures-core", 558 | "futures-task", 559 | "futures-util", 560 | ] 561 | 562 | [[package]] 563 | name = "futures-io" 564 | version = "0.3.21" 565 | source = "registry+https://github.com/rust-lang/crates.io-index" 566 | checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" 567 | 568 | [[package]] 569 | name = "futures-lite" 570 | version = "1.12.0" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" 573 | dependencies = [ 574 | "fastrand", 575 | "futures-core", 576 | "futures-io", 577 | "memchr", 578 | "parking", 579 | "pin-project-lite", 580 | "waker-fn", 581 | ] 582 | 583 | [[package]] 584 | name = "futures-macro" 585 | version = "0.3.21" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" 588 | dependencies = [ 589 | "proc-macro2", 590 | "quote", 591 | "syn", 592 | ] 593 | 594 | [[package]] 595 | name = "futures-sink" 596 | version = "0.3.21" 597 | source = "registry+https://github.com/rust-lang/crates.io-index" 598 | checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" 599 | 600 | [[package]] 601 | name = "futures-task" 602 | version = "0.3.21" 603 | source = "registry+https://github.com/rust-lang/crates.io-index" 604 | checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" 605 | 606 | [[package]] 607 | name = "futures-util" 608 | version = "0.3.21" 609 | source = "registry+https://github.com/rust-lang/crates.io-index" 610 | checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" 611 | dependencies = [ 612 | "futures-channel", 613 | "futures-core", 614 | "futures-io", 615 | "futures-macro", 616 | "futures-sink", 617 | "futures-task", 618 | "memchr", 619 | "pin-project-lite", 620 | "pin-utils", 621 | "slab", 622 | ] 623 | 624 | [[package]] 625 | name = "generic-array" 626 | version = "0.14.5" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" 629 | dependencies = [ 630 | "typenum", 631 | "version_check", 632 | ] 633 | 634 | [[package]] 635 | name = "getopts" 636 | version = "0.2.21" 637 | source = "registry+https://github.com/rust-lang/crates.io-index" 638 | checksum = "14dbbfd5c71d70241ecf9e6f13737f7b5ce823821063188d7e46c41d371eebd5" 639 | dependencies = [ 640 | "unicode-width", 641 | ] 642 | 643 | [[package]] 644 | name = "getrandom" 645 | version = "0.1.16" 646 | source = "registry+https://github.com/rust-lang/crates.io-index" 647 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 648 | dependencies = [ 649 | "cfg-if", 650 | "libc", 651 | "wasi 0.9.0+wasi-snapshot-preview1", 652 | ] 653 | 654 | [[package]] 655 | name = "getrandom" 656 | version = "0.2.7" 657 | source = "registry+https://github.com/rust-lang/crates.io-index" 658 | checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" 659 | dependencies = [ 660 | "cfg-if", 661 | "libc", 662 | "wasi 0.11.0+wasi-snapshot-preview1", 663 | ] 664 | 665 | [[package]] 666 | name = "ghash" 667 | version = "0.3.1" 668 | source = "registry+https://github.com/rust-lang/crates.io-index" 669 | checksum = "97304e4cd182c3846f7575ced3890c53012ce534ad9114046b0a9e00bb30a375" 670 | dependencies = [ 671 | "opaque-debug", 672 | "polyval", 673 | ] 674 | 675 | [[package]] 676 | name = "gloo-timers" 677 | version = "0.2.4" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" 680 | dependencies = [ 681 | "futures-channel", 682 | "futures-core", 683 | "js-sys", 684 | "wasm-bindgen", 685 | ] 686 | 687 | [[package]] 688 | name = "hermit-abi" 689 | version = "0.1.19" 690 | source = "registry+https://github.com/rust-lang/crates.io-index" 691 | checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" 692 | dependencies = [ 693 | "libc", 694 | ] 695 | 696 | [[package]] 697 | name = "hkdf" 698 | version = "0.10.0" 699 | source = "registry+https://github.com/rust-lang/crates.io-index" 700 | checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" 701 | dependencies = [ 702 | "digest", 703 | "hmac", 704 | ] 705 | 706 | [[package]] 707 | name = "hmac" 708 | version = "0.10.1" 709 | source = "registry+https://github.com/rust-lang/crates.io-index" 710 | checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" 711 | dependencies = [ 712 | "crypto-mac", 713 | "digest", 714 | ] 715 | 716 | [[package]] 717 | name = "http" 718 | version = "0.2.8" 719 | source = "registry+https://github.com/rust-lang/crates.io-index" 720 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 721 | dependencies = [ 722 | "bytes 1.1.0", 723 | "fnv", 724 | "itoa", 725 | ] 726 | 727 | [[package]] 728 | name = "http-client" 729 | version = "6.5.2" 730 | source = "registry+https://github.com/rust-lang/crates.io-index" 731 | checksum = "e023af341b797ce2c039f7c6e1d347b68d0f7fd0bc7ac234fe69cfadcca1f89a" 732 | dependencies = [ 733 | "async-std", 734 | "async-trait", 735 | "cfg-if", 736 | "http-types", 737 | "isahc", 738 | "log", 739 | ] 740 | 741 | [[package]] 742 | name = "http-types" 743 | version = "2.12.0" 744 | source = "registry+https://github.com/rust-lang/crates.io-index" 745 | checksum = "6e9b187a72d63adbfba487f48095306ac823049cb504ee195541e91c7775f5ad" 746 | dependencies = [ 747 | "anyhow", 748 | "async-channel", 749 | "async-std", 750 | "base64", 751 | "cookie", 752 | "futures-lite", 753 | "infer", 754 | "pin-project-lite", 755 | "rand 0.7.3", 756 | "serde", 757 | "serde_json", 758 | "serde_qs", 759 | "serde_urlencoded", 760 | "url", 761 | ] 762 | 763 | [[package]] 764 | name = "idna" 765 | version = "0.2.3" 766 | source = "registry+https://github.com/rust-lang/crates.io-index" 767 | checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" 768 | dependencies = [ 769 | "matches", 770 | "unicode-bidi", 771 | "unicode-normalization", 772 | ] 773 | 774 | [[package]] 775 | name = "infer" 776 | version = "0.2.3" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "64e9829a50b42bb782c1df523f78d332fe371b10c661e78b7a3c34b0198e9fac" 779 | 780 | [[package]] 781 | name = "instant" 782 | version = "0.1.12" 783 | source = "registry+https://github.com/rust-lang/crates.io-index" 784 | checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" 785 | dependencies = [ 786 | "cfg-if", 787 | ] 788 | 789 | [[package]] 790 | name = "isahc" 791 | version = "0.9.14" 792 | source = "registry+https://github.com/rust-lang/crates.io-index" 793 | checksum = "e2948a0ce43e2c2ef11d7edf6816508998d99e13badd1150be0914205df9388a" 794 | dependencies = [ 795 | "bytes 0.5.6", 796 | "crossbeam-utils", 797 | "curl", 798 | "curl-sys", 799 | "flume", 800 | "futures-lite", 801 | "http", 802 | "log", 803 | "once_cell", 804 | "slab", 805 | "sluice", 806 | "tracing", 807 | "tracing-futures", 808 | "url", 809 | "waker-fn", 810 | ] 811 | 812 | [[package]] 813 | name = "itoa" 814 | version = "1.0.2" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" 817 | 818 | [[package]] 819 | name = "js-sys" 820 | version = "0.3.58" 821 | source = "registry+https://github.com/rust-lang/crates.io-index" 822 | checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" 823 | dependencies = [ 824 | "wasm-bindgen", 825 | ] 826 | 827 | [[package]] 828 | name = "json" 829 | version = "0.12.4" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "078e285eafdfb6c4b434e0d31e8cfcb5115b651496faca5749b88fafd4f23bfd" 832 | 833 | [[package]] 834 | name = "kv-log-macro" 835 | version = "1.0.7" 836 | source = "registry+https://github.com/rust-lang/crates.io-index" 837 | checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" 838 | dependencies = [ 839 | "log", 840 | ] 841 | 842 | [[package]] 843 | name = "lazy_static" 844 | version = "1.4.0" 845 | source = "registry+https://github.com/rust-lang/crates.io-index" 846 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 847 | 848 | [[package]] 849 | name = "libc" 850 | version = "0.2.126" 851 | source = "registry+https://github.com/rust-lang/crates.io-index" 852 | checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" 853 | 854 | [[package]] 855 | name = "libnghttp2-sys" 856 | version = "0.1.7+1.45.0" 857 | source = "registry+https://github.com/rust-lang/crates.io-index" 858 | checksum = "57ed28aba195b38d5ff02b9170cbff627e336a20925e43b4945390401c5dc93f" 859 | dependencies = [ 860 | "cc", 861 | "libc", 862 | ] 863 | 864 | [[package]] 865 | name = "libz-sys" 866 | version = "1.1.8" 867 | source = "registry+https://github.com/rust-lang/crates.io-index" 868 | checksum = "9702761c3935f8cc2f101793272e202c72b99da8f4224a19ddcf1279a6450bbf" 869 | dependencies = [ 870 | "cc", 871 | "libc", 872 | "pkg-config", 873 | "vcpkg", 874 | ] 875 | 876 | [[package]] 877 | name = "lock_api" 878 | version = "0.4.7" 879 | source = "registry+https://github.com/rust-lang/crates.io-index" 880 | checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" 881 | dependencies = [ 882 | "autocfg", 883 | "scopeguard", 884 | ] 885 | 886 | [[package]] 887 | name = "log" 888 | version = "0.4.17" 889 | source = "registry+https://github.com/rust-lang/crates.io-index" 890 | checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" 891 | dependencies = [ 892 | "cfg-if", 893 | "value-bag", 894 | ] 895 | 896 | [[package]] 897 | name = "matches" 898 | version = "0.1.9" 899 | source = "registry+https://github.com/rust-lang/crates.io-index" 900 | checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" 901 | 902 | [[package]] 903 | name = "memchr" 904 | version = "2.5.0" 905 | source = "registry+https://github.com/rust-lang/crates.io-index" 906 | checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" 907 | 908 | [[package]] 909 | name = "mime" 910 | version = "0.3.16" 911 | source = "registry+https://github.com/rust-lang/crates.io-index" 912 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 913 | 914 | [[package]] 915 | name = "mime_guess" 916 | version = "2.0.4" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" 919 | dependencies = [ 920 | "mime", 921 | "unicase", 922 | ] 923 | 924 | [[package]] 925 | name = "num_cpus" 926 | version = "1.13.1" 927 | source = "registry+https://github.com/rust-lang/crates.io-index" 928 | checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" 929 | dependencies = [ 930 | "hermit-abi", 931 | "libc", 932 | ] 933 | 934 | [[package]] 935 | name = "once_cell" 936 | version = "1.12.0" 937 | source = "registry+https://github.com/rust-lang/crates.io-index" 938 | checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" 939 | 940 | [[package]] 941 | name = "opaque-debug" 942 | version = "0.3.0" 943 | source = "registry+https://github.com/rust-lang/crates.io-index" 944 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 945 | 946 | [[package]] 947 | name = "openssl-probe" 948 | version = "0.1.5" 949 | source = "registry+https://github.com/rust-lang/crates.io-index" 950 | checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" 951 | 952 | [[package]] 953 | name = "openssl-sys" 954 | version = "0.9.74" 955 | source = "registry+https://github.com/rust-lang/crates.io-index" 956 | checksum = "835363342df5fba8354c5b453325b110ffd54044e588c539cf2f20a8014e4cb1" 957 | dependencies = [ 958 | "autocfg", 959 | "cc", 960 | "libc", 961 | "pkg-config", 962 | "vcpkg", 963 | ] 964 | 965 | [[package]] 966 | name = "parking" 967 | version = "2.0.0" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" 970 | 971 | [[package]] 972 | name = "percent-encoding" 973 | version = "2.1.0" 974 | source = "registry+https://github.com/rust-lang/crates.io-index" 975 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 976 | 977 | [[package]] 978 | name = "pin-project" 979 | version = "1.0.10" 980 | source = "registry+https://github.com/rust-lang/crates.io-index" 981 | checksum = "58ad3879ad3baf4e44784bc6a718a8698867bb991f8ce24d1bcbe2cfb4c3a75e" 982 | dependencies = [ 983 | "pin-project-internal", 984 | ] 985 | 986 | [[package]] 987 | name = "pin-project-internal" 988 | version = "1.0.10" 989 | source = "registry+https://github.com/rust-lang/crates.io-index" 990 | checksum = "744b6f092ba29c3650faf274db506afd39944f48420f6c86b17cfe0ee1cb36bb" 991 | dependencies = [ 992 | "proc-macro2", 993 | "quote", 994 | "syn", 995 | ] 996 | 997 | [[package]] 998 | name = "pin-project-lite" 999 | version = "0.2.9" 1000 | source = "registry+https://github.com/rust-lang/crates.io-index" 1001 | checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" 1002 | 1003 | [[package]] 1004 | name = "pin-utils" 1005 | version = "0.1.0" 1006 | source = "registry+https://github.com/rust-lang/crates.io-index" 1007 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1008 | 1009 | [[package]] 1010 | name = "pkg-config" 1011 | version = "0.3.25" 1012 | source = "registry+https://github.com/rust-lang/crates.io-index" 1013 | checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" 1014 | 1015 | [[package]] 1016 | name = "polling" 1017 | version = "2.2.0" 1018 | source = "registry+https://github.com/rust-lang/crates.io-index" 1019 | checksum = "685404d509889fade3e86fe3a5803bca2ec09b0c0778d5ada6ec8bf7a8de5259" 1020 | dependencies = [ 1021 | "cfg-if", 1022 | "libc", 1023 | "log", 1024 | "wepoll-ffi", 1025 | "winapi", 1026 | ] 1027 | 1028 | [[package]] 1029 | name = "polyval" 1030 | version = "0.4.5" 1031 | source = "registry+https://github.com/rust-lang/crates.io-index" 1032 | checksum = "eebcc4aa140b9abd2bc40d9c3f7ccec842679cd79045ac3a7ac698c1a064b7cd" 1033 | dependencies = [ 1034 | "cpuid-bool", 1035 | "opaque-debug", 1036 | "universal-hash", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "ppv-lite86" 1041 | version = "0.2.16" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" 1044 | 1045 | [[package]] 1046 | name = "proc-macro-hack" 1047 | version = "0.5.19" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" 1050 | 1051 | [[package]] 1052 | name = "proc-macro2" 1053 | version = "1.0.39" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" 1056 | dependencies = [ 1057 | "unicode-ident", 1058 | ] 1059 | 1060 | [[package]] 1061 | name = "quote" 1062 | version = "1.0.18" 1063 | source = "registry+https://github.com/rust-lang/crates.io-index" 1064 | checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" 1065 | dependencies = [ 1066 | "proc-macro2", 1067 | ] 1068 | 1069 | [[package]] 1070 | name = "rand" 1071 | version = "0.7.3" 1072 | source = "registry+https://github.com/rust-lang/crates.io-index" 1073 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1074 | dependencies = [ 1075 | "getrandom 0.1.16", 1076 | "libc", 1077 | "rand_chacha 0.2.2", 1078 | "rand_core 0.5.1", 1079 | "rand_hc", 1080 | ] 1081 | 1082 | [[package]] 1083 | name = "rand" 1084 | version = "0.8.5" 1085 | source = "registry+https://github.com/rust-lang/crates.io-index" 1086 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1087 | dependencies = [ 1088 | "libc", 1089 | "rand_chacha 0.3.1", 1090 | "rand_core 0.6.3", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "rand_chacha" 1095 | version = "0.2.2" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1098 | dependencies = [ 1099 | "ppv-lite86", 1100 | "rand_core 0.5.1", 1101 | ] 1102 | 1103 | [[package]] 1104 | name = "rand_chacha" 1105 | version = "0.3.1" 1106 | source = "registry+https://github.com/rust-lang/crates.io-index" 1107 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1108 | dependencies = [ 1109 | "ppv-lite86", 1110 | "rand_core 0.6.3", 1111 | ] 1112 | 1113 | [[package]] 1114 | name = "rand_core" 1115 | version = "0.5.1" 1116 | source = "registry+https://github.com/rust-lang/crates.io-index" 1117 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1118 | dependencies = [ 1119 | "getrandom 0.1.16", 1120 | ] 1121 | 1122 | [[package]] 1123 | name = "rand_core" 1124 | version = "0.6.3" 1125 | source = "registry+https://github.com/rust-lang/crates.io-index" 1126 | checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" 1127 | dependencies = [ 1128 | "getrandom 0.2.7", 1129 | ] 1130 | 1131 | [[package]] 1132 | name = "rand_hc" 1133 | version = "0.2.0" 1134 | source = "registry+https://github.com/rust-lang/crates.io-index" 1135 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1136 | dependencies = [ 1137 | "rand_core 0.5.1", 1138 | ] 1139 | 1140 | [[package]] 1141 | name = "redox_syscall" 1142 | version = "0.2.13" 1143 | source = "registry+https://github.com/rust-lang/crates.io-index" 1144 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" 1145 | dependencies = [ 1146 | "bitflags", 1147 | ] 1148 | 1149 | [[package]] 1150 | name = "redox_users" 1151 | version = "0.4.3" 1152 | source = "registry+https://github.com/rust-lang/crates.io-index" 1153 | checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" 1154 | dependencies = [ 1155 | "getrandom 0.2.7", 1156 | "redox_syscall", 1157 | "thiserror", 1158 | ] 1159 | 1160 | [[package]] 1161 | name = "regex" 1162 | version = "1.5.6" 1163 | source = "registry+https://github.com/rust-lang/crates.io-index" 1164 | checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" 1165 | dependencies = [ 1166 | "aho-corasick", 1167 | "memchr", 1168 | "regex-syntax", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "regex-syntax" 1173 | version = "0.6.26" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" 1176 | 1177 | [[package]] 1178 | name = "rustc_version" 1179 | version = "0.2.3" 1180 | source = "registry+https://github.com/rust-lang/crates.io-index" 1181 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1182 | dependencies = [ 1183 | "semver", 1184 | ] 1185 | 1186 | [[package]] 1187 | name = "ryu" 1188 | version = "1.0.10" 1189 | source = "registry+https://github.com/rust-lang/crates.io-index" 1190 | checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" 1191 | 1192 | [[package]] 1193 | name = "schannel" 1194 | version = "0.1.20" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" 1197 | dependencies = [ 1198 | "lazy_static", 1199 | "windows-sys", 1200 | ] 1201 | 1202 | [[package]] 1203 | name = "scopeguard" 1204 | version = "1.1.0" 1205 | source = "registry+https://github.com/rust-lang/crates.io-index" 1206 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1207 | 1208 | [[package]] 1209 | name = "semver" 1210 | version = "0.9.0" 1211 | source = "registry+https://github.com/rust-lang/crates.io-index" 1212 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1213 | dependencies = [ 1214 | "semver-parser", 1215 | ] 1216 | 1217 | [[package]] 1218 | name = "semver-parser" 1219 | version = "0.7.0" 1220 | source = "registry+https://github.com/rust-lang/crates.io-index" 1221 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1222 | 1223 | [[package]] 1224 | name = "serde" 1225 | version = "1.0.137" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" 1228 | dependencies = [ 1229 | "serde_derive", 1230 | ] 1231 | 1232 | [[package]] 1233 | name = "serde_derive" 1234 | version = "1.0.137" 1235 | source = "registry+https://github.com/rust-lang/crates.io-index" 1236 | checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" 1237 | dependencies = [ 1238 | "proc-macro2", 1239 | "quote", 1240 | "syn", 1241 | ] 1242 | 1243 | [[package]] 1244 | name = "serde_json" 1245 | version = "1.0.81" 1246 | source = "registry+https://github.com/rust-lang/crates.io-index" 1247 | checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" 1248 | dependencies = [ 1249 | "itoa", 1250 | "ryu", 1251 | "serde", 1252 | ] 1253 | 1254 | [[package]] 1255 | name = "serde_qs" 1256 | version = "0.8.5" 1257 | source = "registry+https://github.com/rust-lang/crates.io-index" 1258 | checksum = "c7715380eec75f029a4ef7de39a9200e0a63823176b759d055b613f5a87df6a6" 1259 | dependencies = [ 1260 | "percent-encoding", 1261 | "serde", 1262 | "thiserror", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "serde_urlencoded" 1267 | version = "0.7.1" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" 1270 | dependencies = [ 1271 | "form_urlencoded", 1272 | "itoa", 1273 | "ryu", 1274 | "serde", 1275 | ] 1276 | 1277 | [[package]] 1278 | name = "sha1" 1279 | version = "0.6.1" 1280 | source = "registry+https://github.com/rust-lang/crates.io-index" 1281 | checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" 1282 | dependencies = [ 1283 | "sha1_smol", 1284 | ] 1285 | 1286 | [[package]] 1287 | name = "sha1_smol" 1288 | version = "1.0.0" 1289 | source = "registry+https://github.com/rust-lang/crates.io-index" 1290 | checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" 1291 | 1292 | [[package]] 1293 | name = "sha2" 1294 | version = "0.9.9" 1295 | source = "registry+https://github.com/rust-lang/crates.io-index" 1296 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1297 | dependencies = [ 1298 | "block-buffer", 1299 | "cfg-if", 1300 | "cpufeatures", 1301 | "digest", 1302 | "opaque-debug", 1303 | ] 1304 | 1305 | [[package]] 1306 | name = "slab" 1307 | version = "0.4.6" 1308 | source = "registry+https://github.com/rust-lang/crates.io-index" 1309 | checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" 1310 | 1311 | [[package]] 1312 | name = "sluice" 1313 | version = "0.5.5" 1314 | source = "registry+https://github.com/rust-lang/crates.io-index" 1315 | checksum = "6d7400c0eff44aa2fcb5e31a5f24ba9716ed90138769e4977a2ba6014ae63eb5" 1316 | dependencies = [ 1317 | "async-channel", 1318 | "futures-core", 1319 | "futures-io", 1320 | ] 1321 | 1322 | [[package]] 1323 | name = "socket2" 1324 | version = "0.4.4" 1325 | source = "registry+https://github.com/rust-lang/crates.io-index" 1326 | checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" 1327 | dependencies = [ 1328 | "libc", 1329 | "winapi", 1330 | ] 1331 | 1332 | [[package]] 1333 | name = "spinning_top" 1334 | version = "0.2.4" 1335 | source = "registry+https://github.com/rust-lang/crates.io-index" 1336 | checksum = "75adad84ee84b521fb2cca2d4fd0f1dab1d8d026bda3c5bea4ca63b5f9f9293c" 1337 | dependencies = [ 1338 | "lock_api", 1339 | ] 1340 | 1341 | [[package]] 1342 | name = "standback" 1343 | version = "0.2.17" 1344 | source = "registry+https://github.com/rust-lang/crates.io-index" 1345 | checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" 1346 | dependencies = [ 1347 | "version_check", 1348 | ] 1349 | 1350 | [[package]] 1351 | name = "stdweb" 1352 | version = "0.4.20" 1353 | source = "registry+https://github.com/rust-lang/crates.io-index" 1354 | checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" 1355 | dependencies = [ 1356 | "discard", 1357 | "rustc_version", 1358 | "stdweb-derive", 1359 | "stdweb-internal-macros", 1360 | "stdweb-internal-runtime", 1361 | "wasm-bindgen", 1362 | ] 1363 | 1364 | [[package]] 1365 | name = "stdweb-derive" 1366 | version = "0.5.3" 1367 | source = "registry+https://github.com/rust-lang/crates.io-index" 1368 | checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" 1369 | dependencies = [ 1370 | "proc-macro2", 1371 | "quote", 1372 | "serde", 1373 | "serde_derive", 1374 | "syn", 1375 | ] 1376 | 1377 | [[package]] 1378 | name = "stdweb-internal-macros" 1379 | version = "0.2.9" 1380 | source = "registry+https://github.com/rust-lang/crates.io-index" 1381 | checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" 1382 | dependencies = [ 1383 | "base-x", 1384 | "proc-macro2", 1385 | "quote", 1386 | "serde", 1387 | "serde_derive", 1388 | "serde_json", 1389 | "sha1", 1390 | "syn", 1391 | ] 1392 | 1393 | [[package]] 1394 | name = "stdweb-internal-runtime" 1395 | version = "0.1.5" 1396 | source = "registry+https://github.com/rust-lang/crates.io-index" 1397 | checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" 1398 | 1399 | [[package]] 1400 | name = "subtle" 1401 | version = "2.4.1" 1402 | source = "registry+https://github.com/rust-lang/crates.io-index" 1403 | checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" 1404 | 1405 | [[package]] 1406 | name = "surf" 1407 | version = "2.3.2" 1408 | source = "registry+https://github.com/rust-lang/crates.io-index" 1409 | checksum = "718b1ae6b50351982dedff021db0def601677f2120938b070eadb10ba4038dd7" 1410 | dependencies = [ 1411 | "async-std", 1412 | "async-trait", 1413 | "cfg-if", 1414 | "encoding_rs", 1415 | "futures-util", 1416 | "getrandom 0.2.7", 1417 | "http-client", 1418 | "http-types", 1419 | "log", 1420 | "mime_guess", 1421 | "once_cell", 1422 | "pin-project-lite", 1423 | "serde", 1424 | "serde_json", 1425 | "web-sys", 1426 | ] 1427 | 1428 | [[package]] 1429 | name = "syn" 1430 | version = "1.0.96" 1431 | source = "registry+https://github.com/rust-lang/crates.io-index" 1432 | checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" 1433 | dependencies = [ 1434 | "proc-macro2", 1435 | "quote", 1436 | "unicode-ident", 1437 | ] 1438 | 1439 | [[package]] 1440 | name = "thiserror" 1441 | version = "1.0.31" 1442 | source = "registry+https://github.com/rust-lang/crates.io-index" 1443 | checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" 1444 | dependencies = [ 1445 | "thiserror-impl", 1446 | ] 1447 | 1448 | [[package]] 1449 | name = "thiserror-impl" 1450 | version = "1.0.31" 1451 | source = "registry+https://github.com/rust-lang/crates.io-index" 1452 | checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" 1453 | dependencies = [ 1454 | "proc-macro2", 1455 | "quote", 1456 | "syn", 1457 | ] 1458 | 1459 | [[package]] 1460 | name = "time" 1461 | version = "0.2.27" 1462 | source = "registry+https://github.com/rust-lang/crates.io-index" 1463 | checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" 1464 | dependencies = [ 1465 | "const_fn", 1466 | "libc", 1467 | "standback", 1468 | "stdweb", 1469 | "time-macros", 1470 | "version_check", 1471 | "winapi", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "time-macros" 1476 | version = "0.1.1" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" 1479 | dependencies = [ 1480 | "proc-macro-hack", 1481 | "time-macros-impl", 1482 | ] 1483 | 1484 | [[package]] 1485 | name = "time-macros-impl" 1486 | version = "0.1.2" 1487 | source = "registry+https://github.com/rust-lang/crates.io-index" 1488 | checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" 1489 | dependencies = [ 1490 | "proc-macro-hack", 1491 | "proc-macro2", 1492 | "quote", 1493 | "standback", 1494 | "syn", 1495 | ] 1496 | 1497 | [[package]] 1498 | name = "tinyvec" 1499 | version = "1.6.0" 1500 | source = "registry+https://github.com/rust-lang/crates.io-index" 1501 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1502 | dependencies = [ 1503 | "tinyvec_macros", 1504 | ] 1505 | 1506 | [[package]] 1507 | name = "tinyvec_macros" 1508 | version = "0.1.0" 1509 | source = "registry+https://github.com/rust-lang/crates.io-index" 1510 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1511 | 1512 | [[package]] 1513 | name = "tracing" 1514 | version = "0.1.35" 1515 | source = "registry+https://github.com/rust-lang/crates.io-index" 1516 | checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" 1517 | dependencies = [ 1518 | "cfg-if", 1519 | "log", 1520 | "pin-project-lite", 1521 | "tracing-attributes", 1522 | "tracing-core", 1523 | ] 1524 | 1525 | [[package]] 1526 | name = "tracing-attributes" 1527 | version = "0.1.21" 1528 | source = "registry+https://github.com/rust-lang/crates.io-index" 1529 | checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" 1530 | dependencies = [ 1531 | "proc-macro2", 1532 | "quote", 1533 | "syn", 1534 | ] 1535 | 1536 | [[package]] 1537 | name = "tracing-core" 1538 | version = "0.1.27" 1539 | source = "registry+https://github.com/rust-lang/crates.io-index" 1540 | checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" 1541 | dependencies = [ 1542 | "once_cell", 1543 | ] 1544 | 1545 | [[package]] 1546 | name = "tracing-futures" 1547 | version = "0.2.5" 1548 | source = "registry+https://github.com/rust-lang/crates.io-index" 1549 | checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" 1550 | dependencies = [ 1551 | "pin-project", 1552 | "tracing", 1553 | ] 1554 | 1555 | [[package]] 1556 | name = "typenum" 1557 | version = "1.15.0" 1558 | source = "registry+https://github.com/rust-lang/crates.io-index" 1559 | checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" 1560 | 1561 | [[package]] 1562 | name = "unicase" 1563 | version = "2.6.0" 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" 1565 | checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" 1566 | dependencies = [ 1567 | "version_check", 1568 | ] 1569 | 1570 | [[package]] 1571 | name = "unicode-bidi" 1572 | version = "0.3.8" 1573 | source = "registry+https://github.com/rust-lang/crates.io-index" 1574 | checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" 1575 | 1576 | [[package]] 1577 | name = "unicode-ident" 1578 | version = "1.0.1" 1579 | source = "registry+https://github.com/rust-lang/crates.io-index" 1580 | checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" 1581 | 1582 | [[package]] 1583 | name = "unicode-normalization" 1584 | version = "0.1.19" 1585 | source = "registry+https://github.com/rust-lang/crates.io-index" 1586 | checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" 1587 | dependencies = [ 1588 | "tinyvec", 1589 | ] 1590 | 1591 | [[package]] 1592 | name = "unicode-width" 1593 | version = "0.1.9" 1594 | source = "registry+https://github.com/rust-lang/crates.io-index" 1595 | checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" 1596 | 1597 | [[package]] 1598 | name = "universal-hash" 1599 | version = "0.4.1" 1600 | source = "registry+https://github.com/rust-lang/crates.io-index" 1601 | checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" 1602 | dependencies = [ 1603 | "generic-array", 1604 | "subtle", 1605 | ] 1606 | 1607 | [[package]] 1608 | name = "url" 1609 | version = "2.2.2" 1610 | source = "registry+https://github.com/rust-lang/crates.io-index" 1611 | checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" 1612 | dependencies = [ 1613 | "form_urlencoded", 1614 | "idna", 1615 | "matches", 1616 | "percent-encoding", 1617 | "serde", 1618 | ] 1619 | 1620 | [[package]] 1621 | name = "value-bag" 1622 | version = "1.0.0-alpha.9" 1623 | source = "registry+https://github.com/rust-lang/crates.io-index" 1624 | checksum = "2209b78d1249f7e6f3293657c9779fe31ced465df091bbd433a1cf88e916ec55" 1625 | dependencies = [ 1626 | "ctor", 1627 | "version_check", 1628 | ] 1629 | 1630 | [[package]] 1631 | name = "vcpkg" 1632 | version = "0.2.15" 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" 1634 | checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" 1635 | 1636 | [[package]] 1637 | name = "version_check" 1638 | version = "0.9.4" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1641 | 1642 | [[package]] 1643 | name = "waker-fn" 1644 | version = "1.1.0" 1645 | source = "registry+https://github.com/rust-lang/crates.io-index" 1646 | checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" 1647 | 1648 | [[package]] 1649 | name = "wasi" 1650 | version = "0.9.0+wasi-snapshot-preview1" 1651 | source = "registry+https://github.com/rust-lang/crates.io-index" 1652 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1653 | 1654 | [[package]] 1655 | name = "wasi" 1656 | version = "0.11.0+wasi-snapshot-preview1" 1657 | source = "registry+https://github.com/rust-lang/crates.io-index" 1658 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1659 | 1660 | [[package]] 1661 | name = "wasm-bindgen" 1662 | version = "0.2.81" 1663 | source = "registry+https://github.com/rust-lang/crates.io-index" 1664 | checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" 1665 | dependencies = [ 1666 | "cfg-if", 1667 | "wasm-bindgen-macro", 1668 | ] 1669 | 1670 | [[package]] 1671 | name = "wasm-bindgen-backend" 1672 | version = "0.2.81" 1673 | source = "registry+https://github.com/rust-lang/crates.io-index" 1674 | checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" 1675 | dependencies = [ 1676 | "bumpalo", 1677 | "lazy_static", 1678 | "log", 1679 | "proc-macro2", 1680 | "quote", 1681 | "syn", 1682 | "wasm-bindgen-shared", 1683 | ] 1684 | 1685 | [[package]] 1686 | name = "wasm-bindgen-futures" 1687 | version = "0.4.31" 1688 | source = "registry+https://github.com/rust-lang/crates.io-index" 1689 | checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" 1690 | dependencies = [ 1691 | "cfg-if", 1692 | "js-sys", 1693 | "wasm-bindgen", 1694 | "web-sys", 1695 | ] 1696 | 1697 | [[package]] 1698 | name = "wasm-bindgen-macro" 1699 | version = "0.2.81" 1700 | source = "registry+https://github.com/rust-lang/crates.io-index" 1701 | checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" 1702 | dependencies = [ 1703 | "quote", 1704 | "wasm-bindgen-macro-support", 1705 | ] 1706 | 1707 | [[package]] 1708 | name = "wasm-bindgen-macro-support" 1709 | version = "0.2.81" 1710 | source = "registry+https://github.com/rust-lang/crates.io-index" 1711 | checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" 1712 | dependencies = [ 1713 | "proc-macro2", 1714 | "quote", 1715 | "syn", 1716 | "wasm-bindgen-backend", 1717 | "wasm-bindgen-shared", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "wasm-bindgen-shared" 1722 | version = "0.2.81" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" 1725 | 1726 | [[package]] 1727 | name = "web-sys" 1728 | version = "0.3.58" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" 1731 | dependencies = [ 1732 | "js-sys", 1733 | "wasm-bindgen", 1734 | ] 1735 | 1736 | [[package]] 1737 | name = "wepoll-ffi" 1738 | version = "0.1.2" 1739 | source = "registry+https://github.com/rust-lang/crates.io-index" 1740 | checksum = "d743fdedc5c64377b5fc2bc036b01c7fd642205a0d96356034ae3404d49eb7fb" 1741 | dependencies = [ 1742 | "cc", 1743 | ] 1744 | 1745 | [[package]] 1746 | name = "winapi" 1747 | version = "0.3.9" 1748 | source = "registry+https://github.com/rust-lang/crates.io-index" 1749 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 1750 | dependencies = [ 1751 | "winapi-i686-pc-windows-gnu", 1752 | "winapi-x86_64-pc-windows-gnu", 1753 | ] 1754 | 1755 | [[package]] 1756 | name = "winapi-i686-pc-windows-gnu" 1757 | version = "0.4.0" 1758 | source = "registry+https://github.com/rust-lang/crates.io-index" 1759 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 1760 | 1761 | [[package]] 1762 | name = "winapi-x86_64-pc-windows-gnu" 1763 | version = "0.4.0" 1764 | source = "registry+https://github.com/rust-lang/crates.io-index" 1765 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 1766 | 1767 | [[package]] 1768 | name = "windows-sys" 1769 | version = "0.36.1" 1770 | source = "registry+https://github.com/rust-lang/crates.io-index" 1771 | checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" 1772 | dependencies = [ 1773 | "windows_aarch64_msvc", 1774 | "windows_i686_gnu", 1775 | "windows_i686_msvc", 1776 | "windows_x86_64_gnu", 1777 | "windows_x86_64_msvc", 1778 | ] 1779 | 1780 | [[package]] 1781 | name = "windows_aarch64_msvc" 1782 | version = "0.36.1" 1783 | source = "registry+https://github.com/rust-lang/crates.io-index" 1784 | checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" 1785 | 1786 | [[package]] 1787 | name = "windows_i686_gnu" 1788 | version = "0.36.1" 1789 | source = "registry+https://github.com/rust-lang/crates.io-index" 1790 | checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" 1791 | 1792 | [[package]] 1793 | name = "windows_i686_msvc" 1794 | version = "0.36.1" 1795 | source = "registry+https://github.com/rust-lang/crates.io-index" 1796 | checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" 1797 | 1798 | [[package]] 1799 | name = "windows_x86_64_gnu" 1800 | version = "0.36.1" 1801 | source = "registry+https://github.com/rust-lang/crates.io-index" 1802 | checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" 1803 | 1804 | [[package]] 1805 | name = "windows_x86_64_msvc" 1806 | version = "0.36.1" 1807 | source = "registry+https://github.com/rust-lang/crates.io-index" 1808 | checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" 1809 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "colortty" 3 | version = "0.2.5" 4 | authors = ["Shuhei Kagawa "] 5 | license = "MIT" 6 | repository = "https://github.com/shuhei/colortty" 7 | readme = "README.md" 8 | keywords = ["alacritty", "color"] 9 | categories = ["command-line-utilities"] 10 | description = "A utility to generate color schemes for alacritty" 11 | edition = "2018" 12 | 13 | [dependencies] 14 | getopts = "0.2.21" 15 | RustyXML = "0.3.0" 16 | regex = "1.5.6" 17 | json = "0.12.4" 18 | thiserror = "1.0" 19 | anyhow = "1.0" 20 | dirs = "4.0.0" 21 | futures = "0.3.21" 22 | surf = "2.3.2" 23 | 24 | [dependencies.async-std] 25 | version = "1.11.0" 26 | features = ["attributes"] 27 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Shuhei Kagawa 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # colortty 2 | 3 | colortty is a utility to generate color schemes for [alacritty](https://github.com/jwilm/alacritty). It also supports the following conversions: 4 | 5 | - iTerm 2 -> alacritty 6 | - [mintty](https://github.com/mintty/mintty) -> alacritty 7 | - [Gogh](https://github.com/Gogh-Co/Gogh) -> alacritty 8 | 9 | ![screenshot of colortty list](img/list.png) 10 | 11 | ## Installation 12 | 13 | ```sh 14 | cargo install colortty 15 | ``` 16 | 17 | ## Usage 18 | 19 | ```sh 20 | colortty - color scheme converter for alacritty 21 | 22 | USAGE: 23 | # List color schemes at https://github.com/mbadolato/iTerm2-Color-Schemes 24 | colortty list 25 | colortty list -p iterm 26 | colortty list -u # update cached color schemes 27 | 28 | # List color schemes at https://github.com/Gogh-Co/Gogh 29 | colortty list -p gogh 30 | colortty list -p gogh -u # update cached color schemes 31 | 32 | # Get color scheme from https://github.com/mbadolato/iTerm2-Color-Schemes 33 | colortty get 34 | colortty get -p iterm 35 | 36 | # Get color scheme from https://github.com/Gogh-Co/Gogh 37 | colortty get -p gogh 38 | 39 | # Convert with implicit input type 40 | colortty convert some-color.itermcolors 41 | colortty convert some-color.minttyrc 42 | colortty convert some-color.sh 43 | 44 | # Convert with explicit input type 45 | colortty convert -i iterm some-color-theme 46 | colortty convert -i mintty some-color-theme 47 | colortty convert -i gogh some-color-theme 48 | 49 | # Convert stdin (explicit input type is necessary) 50 | cat some-color-theme | colortty convert -i iterm - 51 | cat some-color-theme | colortty convert -i mintty - 52 | cat some-color-theme | colortty convert -i gogh -" 53 | ``` 54 | 55 | ## Development 56 | 57 | Install: 58 | 59 | ```sh 60 | cargo install --path . 61 | ``` 62 | 63 | Build: 64 | 65 | ```sh 66 | cargo build 67 | ``` 68 | 69 | Test: 70 | 71 | ```sh 72 | cargo test 73 | ``` 74 | 75 | ## License 76 | 77 | MIT 78 | -------------------------------------------------------------------------------- /img/list.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shuhei/colortty/0437a72e323f7da26224b41de864abeef5e99f75/img/list.png -------------------------------------------------------------------------------- /src/color.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{Context, Result}; 2 | use regex::Regex; 3 | use xml::{Element, Xml}; 4 | 5 | pub enum ColorSchemeFormat { 6 | ITerm, 7 | Mintty, 8 | Gogh, 9 | } 10 | 11 | impl ColorSchemeFormat { 12 | pub fn from_string(s: &str) -> Option { 13 | match s { 14 | "iterm" => Some(Self::ITerm), 15 | "mintty" => Some(Self::Mintty), 16 | "gogh" => Some(Self::Gogh), 17 | _ => None, 18 | } 19 | } 20 | 21 | pub fn from_filename(s: &str) -> Option { 22 | if s.ends_with(".itermcolors") { 23 | Some(Self::ITerm) 24 | } else if s.ends_with(".minttyrc") { 25 | Some(Self::Mintty) 26 | } else if s.ends_with(".sh") { 27 | Some(Self::Gogh) 28 | } else { 29 | None 30 | } 31 | } 32 | } 33 | 34 | pub enum AlacrittyConfigFormat { 35 | // Until 0.12. 36 | Yaml, 37 | // From 0.13. 38 | Toml, 39 | } 40 | 41 | impl AlacrittyConfigFormat { 42 | pub fn from_string(s: &str) -> Option { 43 | match s { 44 | "yaml" => Some(Self::Yaml), 45 | "toml" => Some(Self::Toml), 46 | _ => None, 47 | } 48 | } 49 | } 50 | 51 | #[derive(thiserror::Error, Debug, PartialEq)] 52 | pub enum ParseError { 53 | // -- Generic errors 54 | #[error("failed to parse int")] 55 | ParseInt, 56 | 57 | #[error("failed to parse float")] 58 | ParseFloat, 59 | 60 | // -- Mintty parse errors 61 | #[error("invalid color representation: {0}")] 62 | InvalidColorFormat(String), 63 | 64 | #[error("invalid line: {0}")] 65 | InvalidLineFormat(String), 66 | 67 | #[error("unknown color name: {0}")] 68 | UnknownColorName(String), 69 | 70 | // -- iTerm parse errors 71 | #[error("invalid XML")] 72 | XMLParse, 73 | 74 | #[error("root dict was not found")] 75 | NoRootDict, 76 | 77 | #[error("cannot extract text from: {0}")] 78 | NotCharacterNode(Box), 79 | 80 | #[error("unknown color component: {0}")] 81 | UnknownColorComponent(String), 82 | } 83 | 84 | #[derive(Debug, Default, PartialEq)] 85 | pub struct Color { 86 | pub red: u8, 87 | pub green: u8, 88 | pub blue: u8, 89 | } 90 | 91 | impl Color { 92 | pub fn from_mintty_color(s: &str) -> Result { 93 | let rgb: Vec<_> = s.split(',').collect(); 94 | if rgb.len() != 3 { 95 | return Err(ParseError::InvalidColorFormat(s.to_owned()).into()); 96 | } 97 | let red = parse_int(rgb[0])?; 98 | let green = parse_int(rgb[1])?; 99 | let blue = parse_int(rgb[2])?; 100 | Ok(Color { red, green, blue }) 101 | } 102 | 103 | pub fn from_gogh_color(s: &str) -> Result { 104 | let red = parse_hex(&s[1..3])?; 105 | let green = parse_hex(&s[3..5])?; 106 | let blue = parse_hex(&s[5..7])?; 107 | Ok(Color { red, green, blue }) 108 | } 109 | 110 | pub fn to_hex(&self) -> String { 111 | format!("0x{:>02x}{:>02x}{:>02x}", self.red, self.green, self.blue) 112 | } 113 | 114 | pub fn to_24bit_be(&self) -> String { 115 | format!("\x1b[48;2;{};{};{}m", self.red, self.green, self.blue) 116 | } 117 | 118 | pub fn to_24bit_preview(&self) -> String { 119 | format!("\x1b[38;2;{};{};{}m●", self.red, self.green, self.blue) 120 | } 121 | } 122 | 123 | fn parse_int(s: &str) -> Result { 124 | Ok(s.parse::().context(ParseError::ParseInt)?) 125 | } 126 | 127 | fn parse_hex(s: &str) -> Result { 128 | Ok(u8::from_str_radix(s, 16).context(ParseError::ParseInt)?) 129 | } 130 | 131 | fn extract_text(element: &Element) -> Result<&str> { 132 | let first = &element.children[0]; 133 | match first { 134 | Xml::CharacterNode(ref text) => Ok(text), 135 | _ => Err(ParseError::NotCharacterNode(Box::new(first.to_owned())).into()), 136 | } 137 | } 138 | 139 | fn extract_real_color(element: &Element) -> Result { 140 | let real_value = extract_text(element)? 141 | .parse::() 142 | .context(ParseError::ParseFloat)?; 143 | let int_value = (real_value * 255.0) as u8; 144 | Ok(int_value) 145 | } 146 | 147 | #[derive(Default)] 148 | pub struct ColorScheme { 149 | foreground: Color, 150 | background: Color, 151 | cursor_text: Option, 152 | cursor: Option, 153 | 154 | black: Color, 155 | red: Color, 156 | green: Color, 157 | yellow: Color, 158 | blue: Color, 159 | magenta: Color, 160 | cyan: Color, 161 | white: Color, 162 | 163 | bright_black: Color, 164 | bright_red: Color, 165 | bright_green: Color, 166 | bright_yellow: Color, 167 | bright_blue: Color, 168 | bright_magenta: Color, 169 | bright_cyan: Color, 170 | bright_white: Color, 171 | } 172 | 173 | impl ColorScheme { 174 | // From a mintty color theme (.minttyrc) 175 | pub fn from_minttyrc(content: &str) -> Result { 176 | let mut scheme = ColorScheme::default(); 177 | for line in content.lines() { 178 | let components: Vec<&str> = line.split('=').collect(); 179 | if components.len() != 2 { 180 | return Err(ParseError::InvalidLineFormat(line.to_owned()).into()); 181 | } 182 | let name = components[0]; 183 | let color = Color::from_mintty_color(components[1])?; 184 | match name { 185 | "ForegroundColour" => scheme.foreground = color, 186 | "BackgroundColour" => scheme.background = color, 187 | "Black" => scheme.black = color, 188 | "Red" => scheme.red = color, 189 | "Green" => scheme.green = color, 190 | "Yellow" => scheme.yellow = color, 191 | "Blue" => scheme.blue = color, 192 | "Magenta" => scheme.magenta = color, 193 | "Cyan" => scheme.cyan = color, 194 | "White" => scheme.white = color, 195 | "BoldRed" => scheme.bright_red = color, 196 | "BoldBlack" => scheme.bright_black = color, 197 | "BoldGreen" => scheme.bright_green = color, 198 | "BoldYellow" => scheme.bright_yellow = color, 199 | "BoldBlue" => scheme.bright_blue = color, 200 | "BoldMagenta" => scheme.bright_magenta = color, 201 | "BoldCyan" => scheme.bright_cyan = color, 202 | "BoldWhite" => scheme.bright_white = color, 203 | _ => return Err(ParseError::UnknownColorName(name.to_owned()).into()), 204 | } 205 | } 206 | Ok(scheme) 207 | } 208 | 209 | // From an iTerm 2 color theme (.itermcolors) 210 | pub fn from_iterm(content: &str) -> Result { 211 | let mut scheme = ColorScheme::default(); 212 | 213 | let root = content.parse::().context(ParseError::XMLParse)?; 214 | let root_dict: &Element = root 215 | .get_children("dict", None) 216 | .nth(0) 217 | .ok_or(ParseError::NoRootDict)?; 218 | 219 | let keys = root_dict.get_children("key", None); 220 | let values = root_dict.get_children("dict", None); 221 | for (key, value) in keys.zip(values) { 222 | let color_name = extract_text(key)?; 223 | 224 | let mut color = Color::default(); 225 | // Extract element pairs like 226 | // `element.get_children()` doesn't work well here because there might be 227 | // a pattern like . 228 | // In this case, we want to ignore the second pair (). 229 | let element_nodes = value 230 | .children 231 | .iter() 232 | .flat_map(|child| match child { 233 | Xml::ElementNode(elem) => Some(elem), 234 | _ => None, 235 | }) 236 | .collect::>(); 237 | for pair in element_nodes.chunks(2) { 238 | if let [color_key, color_value] = pair { 239 | let component_name = extract_text(color_key)?; 240 | match component_name { 241 | "Red Component" => color.red = extract_real_color(color_value)?, 242 | "Green Component" => color.green = extract_real_color(color_value)?, 243 | "Blue Component" => color.blue = extract_real_color(color_value)?, 244 | "Alpha Component" => {} 245 | "Color Space" => {} 246 | _ => { 247 | return Err(ParseError::UnknownColorComponent( 248 | component_name.to_owned(), 249 | ) 250 | .into()); 251 | } 252 | }; 253 | } 254 | } 255 | 256 | match color_name { 257 | "Ansi 0 Color" => scheme.black = color, 258 | "Ansi 1 Color" => scheme.red = color, 259 | "Ansi 2 Color" => scheme.green = color, 260 | "Ansi 3 Color" => scheme.yellow = color, 261 | "Ansi 4 Color" => scheme.blue = color, 262 | "Ansi 5 Color" => scheme.magenta = color, 263 | "Ansi 6 Color" => scheme.cyan = color, 264 | "Ansi 7 Color" => scheme.white = color, 265 | "Ansi 8 Color" => scheme.bright_black = color, 266 | "Ansi 9 Color" => scheme.bright_red = color, 267 | "Ansi 10 Color" => scheme.bright_green = color, 268 | "Ansi 11 Color" => scheme.bright_yellow = color, 269 | "Ansi 12 Color" => scheme.bright_blue = color, 270 | "Ansi 13 Color" => scheme.bright_magenta = color, 271 | "Ansi 14 Color" => scheme.bright_cyan = color, 272 | "Ansi 15 Color" => scheme.bright_white = color, 273 | "Background Color" => scheme.background = color, 274 | "Foreground Color" => scheme.foreground = color, 275 | "Cursor Color" => scheme.cursor = Some(color), 276 | "Cursor Text Color" => scheme.cursor_text = Some(color), 277 | _ => (), 278 | } 279 | } 280 | 281 | Ok(scheme) 282 | } 283 | 284 | // From a gogh color theme file (.sh) 285 | pub fn from_gogh(content: &str) -> Result { 286 | // Match against export XXX="yyy" 287 | let pattern = Regex::new(r#"export ([A-Z0-9_]+)="(#[0-9a-fA-F]{6})""#).unwrap(); 288 | let mut scheme = ColorScheme::default(); 289 | for line in content.lines() { 290 | if let Some(caps) = pattern.captures(line) { 291 | let name = caps.get(1).unwrap().as_str(); 292 | let color = Color::from_gogh_color(caps.get(2).unwrap().as_str())?; 293 | match name { 294 | "FOREGROUND_COLOR" => scheme.foreground = color, 295 | "BACKGROUND_COLOR" => scheme.background = color, 296 | "COLOR_01" => scheme.black = color, 297 | "COLOR_02" => scheme.red = color, 298 | "COLOR_03" => scheme.green = color, 299 | "COLOR_04" => scheme.yellow = color, 300 | "COLOR_05" => scheme.blue = color, 301 | "COLOR_06" => scheme.magenta = color, 302 | "COLOR_07" => scheme.cyan = color, 303 | "COLOR_08" => scheme.white = color, 304 | "COLOR_09" => scheme.bright_black = color, 305 | "COLOR_10" => scheme.bright_red = color, 306 | "COLOR_11" => scheme.bright_green = color, 307 | "COLOR_12" => scheme.bright_yellow = color, 308 | "COLOR_13" => scheme.bright_blue = color, 309 | "COLOR_14" => scheme.bright_magenta = color, 310 | "COLOR_15" => scheme.bright_cyan = color, 311 | "COLOR_16" => scheme.bright_white = color, 312 | _ => {} 313 | } 314 | } 315 | } 316 | Ok(scheme) 317 | } 318 | 319 | // Output YAML that can be used as a color theme in .alacritty.yml 320 | pub fn to_yaml(&self) -> String { 321 | let cursor_colors = match (&self.cursor_text, &self.cursor) { 322 | (Some(cursor_text), Some(cursor)) => format!( 323 | " 324 | # Cursor colors 325 | cursor: 326 | text: '{}' 327 | cursor: '{}' 328 | ", 329 | cursor_text.to_hex(), 330 | cursor.to_hex() 331 | ), 332 | _ => String::new(), 333 | }; 334 | 335 | format!( 336 | "colors: 337 | # Default colors 338 | primary: 339 | background: '{}' 340 | foreground: '{}' 341 | {} 342 | # Normal colors 343 | normal: 344 | black: '{}' 345 | red: '{}' 346 | green: '{}' 347 | yellow: '{}' 348 | blue: '{}' 349 | magenta: '{}' 350 | cyan: '{}' 351 | white: '{}' 352 | 353 | # Bright colors 354 | bright: 355 | black: '{}' 356 | red: '{}' 357 | green: '{}' 358 | yellow: '{}' 359 | blue: '{}' 360 | magenta: '{}' 361 | cyan: '{}' 362 | white: '{}' 363 | ", 364 | self.background.to_hex(), 365 | self.foreground.to_hex(), 366 | cursor_colors, 367 | self.black.to_hex(), 368 | self.red.to_hex(), 369 | self.green.to_hex(), 370 | self.yellow.to_hex(), 371 | self.blue.to_hex(), 372 | self.magenta.to_hex(), 373 | self.cyan.to_hex(), 374 | self.white.to_hex(), 375 | self.bright_black.to_hex(), 376 | self.bright_red.to_hex(), 377 | self.bright_green.to_hex(), 378 | self.bright_yellow.to_hex(), 379 | self.bright_blue.to_hex(), 380 | self.bright_magenta.to_hex(), 381 | self.bright_cyan.to_hex(), 382 | self.bright_white.to_hex(), 383 | ) 384 | } 385 | 386 | // Show all colors in one line 387 | pub fn to_preview(&self) -> String { 388 | let colors = vec![ 389 | self.background.to_24bit_be(), 390 | " ".to_string(), 391 | self.foreground.to_24bit_preview(), 392 | " ".to_string(), 393 | self.black.to_24bit_preview(), 394 | self.red.to_24bit_preview(), 395 | self.green.to_24bit_preview(), 396 | self.yellow.to_24bit_preview(), 397 | self.blue.to_24bit_preview(), 398 | self.magenta.to_24bit_preview(), 399 | self.cyan.to_24bit_preview(), 400 | self.white.to_24bit_preview(), 401 | " ".to_string(), 402 | self.bright_black.to_24bit_preview(), 403 | self.bright_red.to_24bit_preview(), 404 | self.bright_green.to_24bit_preview(), 405 | self.bright_yellow.to_24bit_preview(), 406 | self.bright_blue.to_24bit_preview(), 407 | self.bright_magenta.to_24bit_preview(), 408 | self.bright_cyan.to_24bit_preview(), 409 | self.bright_white.to_24bit_preview(), 410 | " ".to_string(), 411 | "\x1b[0m".to_string(), 412 | ]; 413 | colors.join("") 414 | } 415 | } 416 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | pub mod color; 2 | pub mod provider; 3 | 4 | pub use crate::color::{AlacrittyConfigFormat, Color, ColorScheme, ColorSchemeFormat}; 5 | pub use crate::provider::Provider; 6 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, bail, Context, Result}; 2 | use colortty::{AlacrittyConfigFormat, ColorScheme, ColorSchemeFormat, Provider}; 3 | use getopts::Options; 4 | use std::env; 5 | use std::fs::File; 6 | use std::io::{self, Read}; 7 | use std::process; 8 | 9 | #[async_std::main] 10 | async fn main() { 11 | let args: Vec = env::args().collect(); 12 | 13 | if args.len() < 2 { 14 | return help(); 15 | } 16 | 17 | match args[1].as_ref() { 18 | "convert" => handle_error(convert(args)), 19 | "list" => handle_error(list(args).await), 20 | "get" => handle_error(get(args).await), 21 | "help" => help(), 22 | _ => { 23 | eprintln!("error: no such subcommand: `{}`", args[1]); 24 | process::exit(1); 25 | } 26 | }; 27 | } 28 | 29 | fn handle_error(result: Result<()>) { 30 | if let Err(e) = result { 31 | eprintln!("error: {}", e); 32 | process::exit(1); 33 | } 34 | } 35 | 36 | // -- commands 37 | 38 | fn convert(args: Vec) -> Result<()> { 39 | let mut opts = Options::new(); 40 | opts.optopt( 41 | "i", 42 | "input-format", 43 | "input format: 'iterm'|'mintty'|'gogh'", 44 | "INPUT_FORMAT", 45 | ); 46 | opts.optopt( 47 | "o", 48 | "output-format", 49 | "output format: 'yaml'|'toml'", 50 | "OUTPUT_FORMAT", 51 | ); 52 | let matches = opts 53 | .parse(&args[2..]) 54 | .context("Failed to parse arguments")?; 55 | 56 | if matches.free.is_empty() { 57 | bail!("Source is not specified"); 58 | } 59 | 60 | let source = &matches.free[0]; 61 | let input_format = matches 62 | .opt_str("i") 63 | .and_then(|s| ColorSchemeFormat::from_string(&s)) 64 | .or_else(|| ColorSchemeFormat::from_filename(&source)) 65 | .ok_or(anyhow!( 66 | "Input format is not specified and failed to guess from the source file name" 67 | ))?; 68 | let output_format = matches 69 | .opt_str("o") 70 | .and_then(|s| AlacrittyConfigFormat::from_string(&s)) 71 | .unwrap_or(AlacrittyConfigFormat::Yaml); 72 | 73 | let mut buffer = String::new(); 74 | if source == "-" { 75 | io::stdin() 76 | .read_to_string(&mut buffer) 77 | .context("Failed to read stdin")?; 78 | } else { 79 | File::open(source) 80 | .unwrap() 81 | .read_to_string(&mut buffer) 82 | .with_context(|| format!("Failed to read: {}", source))?; 83 | } 84 | 85 | let scheme = match input_format { 86 | ColorSchemeFormat::ITerm => ColorScheme::from_iterm(&buffer), 87 | ColorSchemeFormat::Mintty => ColorScheme::from_minttyrc(&buffer), 88 | ColorSchemeFormat::Gogh => ColorScheme::from_gogh(&buffer), 89 | }?; 90 | let output = match output_format { 91 | AlacrittyConfigFormat::Yaml => scheme.to_yaml(), 92 | // TODO: Output in toml. 93 | AlacrittyConfigFormat::Toml => scheme.to_yaml(), 94 | }; 95 | println!("{}", output); 96 | 97 | Ok(()) 98 | } 99 | 100 | async fn list(args: Vec) -> Result<()> { 101 | let mut opts = Options::new(); 102 | set_provider_option(&mut opts); 103 | opts.optflag("u", "update-cache", "update color scheme cache"); 104 | 105 | let matches = opts 106 | .parse(&args[2..]) 107 | .context("Failed to parse arguments")?; 108 | let provider = get_provider(&matches)?; 109 | 110 | if matches.opt_present("u") { 111 | provider.download_all().await?; 112 | } 113 | 114 | let color_schemes = provider.list().await?; 115 | 116 | let mut max_name_length = 0; 117 | for (name, _) in &color_schemes { 118 | max_name_length = max_name_length.max(name.len()); 119 | } 120 | 121 | for (name, color_scheme) in &color_schemes { 122 | println!( 123 | "{:width$} {}", 124 | name, 125 | color_scheme.to_preview(), 126 | width = max_name_length 127 | ); 128 | } 129 | 130 | Ok(()) 131 | } 132 | 133 | async fn get(args: Vec) -> Result<()> { 134 | let mut opts = Options::new(); 135 | set_provider_option(&mut opts); 136 | let matches = opts 137 | .parse(&args[2..]) 138 | .context("Failed to parse arguments")?; 139 | 140 | if matches.free.is_empty() { 141 | bail!("Color scheme name is missing"); 142 | } 143 | let name = &matches.free[0].to_string(); 144 | 145 | let provider = get_provider(&matches)?; 146 | let color_scheme = provider.get(name).await?; 147 | print!("# {}\n{}", name, color_scheme.to_yaml()); 148 | 149 | Ok(()) 150 | } 151 | 152 | fn help() { 153 | println!( 154 | "colortty - color scheme converter for alacritty 155 | 156 | USAGE: 157 | # List color schemes at https://github.com/mbadolato/iTerm2-Color-Schemes 158 | colortty list 159 | colortty list -p iterm 160 | colortty list -u # update cached color schemes 161 | 162 | # List color schemes at https://github.com/Mayccoll/Gogh 163 | colortty list -p gogh 164 | colortty list -p gogh -u # update cached color schemes 165 | 166 | # Get color scheme from https://github.com/mbadolato/iTerm2-Color-Schemes 167 | colortty get 168 | colortty get -p iterm 169 | 170 | # Get color scheme from https://github.com/Mayccoll/Gogh 171 | colortty get -p gogh 172 | 173 | # Convert with implicit input type 174 | colortty convert some-color.itermcolors 175 | colortty convert some-color.minttyrc 176 | colortty convert some-color.sh 177 | 178 | # Convert with explicit input type 179 | colortty convert -i iterm some-color-theme 180 | colortty convert -i mintty some-color-theme 181 | colortty convert -i gogh some-color-theme 182 | 183 | # Convert stdin (explicit input type is necessary) 184 | cat some-color-theme | colortty convert -i iterm - 185 | cat some-color-theme | colortty convert -i mintty - 186 | cat some-color-theme | colortty convert -i gogh -" 187 | ); 188 | } 189 | 190 | // -- Utility functions 191 | 192 | fn set_provider_option(opts: &mut getopts::Options) { 193 | opts.optopt( 194 | "p", 195 | "provider", 196 | "color scheme provider: 'iterm'|'gogh'", 197 | "PROVIDER", 198 | ); 199 | } 200 | 201 | fn get_provider(matches: &getopts::Matches) -> Result { 202 | let provider_name = matches.opt_str("p").unwrap_or_else(|| "iterm".to_owned()); 203 | let provider = match provider_name.as_ref() { 204 | "iterm" => Provider::iterm(), 205 | "gogh" => Provider::gogh(), 206 | _ => bail!("Unknown color scheme provider: {}", provider_name), 207 | }; 208 | Ok(provider) 209 | } 210 | -------------------------------------------------------------------------------- /src/provider.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, bail, Context, Result}; 2 | use async_std::{fs, prelude::*}; 3 | use dirs; 4 | use futures::future; 5 | use std::path::PathBuf; 6 | use surf::RequestBuilder; 7 | 8 | use crate::color::ColorScheme; 9 | 10 | /// A GitHub repository that provides color schemes. 11 | pub struct Provider { 12 | user_name: String, 13 | repo_name: String, 14 | list_path: String, 15 | extension: String, 16 | } 17 | 18 | impl Provider { 19 | /// Returns a provider for `mbadolato/iTerm2-Color-Schemes`. 20 | pub fn iterm() -> Self { 21 | Provider::new( 22 | "mbadolato", 23 | "iTerm2-Color-Schemes", 24 | "schemes", 25 | ".itermcolors", 26 | ) 27 | } 28 | 29 | /// Returns a provider for `Gogh-Co/Gogh`. 30 | pub fn gogh() -> Self { 31 | Provider::new("Gogh-Co", "Gogh", "themes", ".sh") 32 | } 33 | 34 | /// Returns a provider instance. 35 | fn new(user_name: &str, repo_name: &str, list_path: &str, extension: &str) -> Self { 36 | Provider { 37 | user_name: user_name.to_string(), 38 | repo_name: repo_name.to_string(), 39 | list_path: list_path.to_string(), 40 | extension: extension.to_string(), 41 | } 42 | } 43 | 44 | /// Fetches the raw content of the color scheme for the given name. 45 | pub async fn get(&self, name: &str) -> Result { 46 | let req = surf::get(&self.individual_url(name)); 47 | let body = send_http_request(req) 48 | .await 49 | .with_context(|| format!("Failed to get color scheme raw content for {}", name))?; 50 | self.parse_color_scheme(&body) 51 | } 52 | 53 | /// Returns all color schemes in the provider. 54 | /// 55 | /// This function caches color schemes in the file system. 56 | pub async fn list(self) -> Result> { 57 | match self.read_color_schemes().await { 58 | Ok(color_schemes) => { 59 | if color_schemes.len() > 0 { 60 | return Ok(color_schemes); 61 | } 62 | } 63 | _ => {} 64 | } 65 | 66 | // If there are no cached files, download them. 67 | self.download_all().await?; 68 | self.read_color_schemes().await 69 | } 70 | 71 | /// Download color scheme files into the cache directory. 72 | pub async fn download_all(&self) -> Result<()> { 73 | let repo_dir = self.repo_dir()?; 74 | 75 | eprintln!( 76 | "Downloading color schemes into {}", 77 | repo_dir.to_str().unwrap() 78 | ); 79 | 80 | // Create the cache directory if it doesn't exist. 81 | fs::create_dir_all(&repo_dir) 82 | .await 83 | .context("Failed to create the cache directory")?; 84 | 85 | let list_req = surf::get(&self.list_url()); 86 | let list_body = send_http_request(list_req) 87 | .await 88 | .context("Failed to download a color scheme list")?; 89 | let items = json::parse(&list_body).context("Failed to parse a color scheme list")?; 90 | 91 | // Download and save color scheme files. 92 | let mut futures = Vec::new(); 93 | for item in items.members() { 94 | let filename = item["name"].as_str().unwrap(); 95 | 96 | // Ignoring files starting with `_` for Gogh. 97 | if filename.starts_with('_') || !filename.ends_with(&self.extension) { 98 | continue; 99 | } 100 | 101 | let name = filename.replace(&self.extension, ""); 102 | let req = surf::get(&self.individual_url(&name)); 103 | futures.push(self.download_color_scheme(req, name)); 104 | 105 | // Download files in batches. 106 | // 107 | // If this requests all files in parallel, the HTTP client (isahc) throws the 108 | // following error: 109 | // 110 | // HTTP request error: ConnectFailed: failed to connect to the server 111 | // 112 | // isahc doesn't limit the number of connections per client by default, but 113 | // it exposes an API to limit it. However, surf doesn't expose the API. 114 | if futures.len() > 10 { 115 | future::try_join_all(futures).await?; 116 | futures = Vec::new(); 117 | } 118 | } 119 | 120 | Ok(()) 121 | } 122 | 123 | /// Read color schemes from the cache directory. 124 | async fn read_color_schemes(&self) -> Result> { 125 | let mut entries = fs::read_dir(self.repo_dir()?) 126 | .await 127 | .context("Failed to read the cache directory")?; 128 | 129 | // Collect futures and run them in parallel. 130 | let mut futures = Vec::new(); 131 | while let Some(entry) = entries.next().await { 132 | let dir_entry = entry.context("Failed to read the cache directory entry")?; 133 | let filename = dir_entry.file_name().into_string().unwrap(); 134 | 135 | let name = filename.replace(&self.extension, "").to_string(); 136 | futures.push(self.read_color_scheme(name)); 137 | } 138 | 139 | let color_schemes = future::try_join_all(futures).await?; 140 | 141 | Ok(color_schemes) 142 | } 143 | 144 | /// Reads a color scheme from the repository cache. 145 | async fn read_color_scheme(&self, name: String) -> Result<(String, ColorScheme)> { 146 | let file_path = self.individual_path(&name)?; 147 | 148 | let body = fs::read_to_string(file_path) 149 | .await 150 | .with_context(|| format!("Failed to read the color scheme file for {}", name))?; 151 | let color_scheme = self.parse_color_scheme(&body)?; 152 | 153 | Ok((name, color_scheme)) 154 | } 155 | 156 | /// Downloads a color scheme file and save it in the cache directory. 157 | async fn download_color_scheme(&self, req: RequestBuilder, name: String) -> Result<()> { 158 | let body = send_http_request(req) 159 | .await 160 | .with_context(|| format!("Failed to download a color scheme file for {}", name))?; 161 | fs::write(self.individual_path(&name)?, body) 162 | .await 163 | .with_context(|| format!("Failed to write a color scheme file for {}", name))?; 164 | Ok(()) 165 | } 166 | 167 | /// The repository cache directory. 168 | fn repo_dir(&self) -> Result { 169 | let mut repo_dir = dirs::cache_dir().ok_or(anyhow!("There is no cache directory"))?; 170 | repo_dir.push("colortty"); 171 | repo_dir.push("repositories"); 172 | repo_dir.push(&self.user_name); 173 | repo_dir.push(&self.repo_name); 174 | Ok(repo_dir) 175 | } 176 | 177 | /// Returns the path for the given color scheme name. 178 | fn individual_path(&self, name: &str) -> Result { 179 | let mut file_path = self.repo_dir()?; 180 | file_path.push(name); 181 | file_path.set_extension(&self.extension[1..]); 182 | Ok(file_path) 183 | } 184 | 185 | /// Returns the URL for a color scheme on GitHub. 186 | fn individual_url(&self, name: &str) -> String { 187 | format!( 188 | "https://raw.githubusercontent.com/{}/{}/master/{}/{}{}", 189 | self.user_name, self.repo_name, self.list_path, name, self.extension 190 | ) 191 | } 192 | 193 | /// Returns the URL for the color scheme list on GitHub API. 194 | fn list_url(&self) -> String { 195 | format!( 196 | "https://api.github.com/repos/{}/{}/contents/{}", 197 | self.user_name, self.repo_name, self.list_path 198 | ) 199 | } 200 | 201 | /// Parses a color scheme data. 202 | fn parse_color_scheme(&self, body: &str) -> Result { 203 | // TODO: Think about better abstraction. 204 | if self.extension == ".itermcolors" { 205 | ColorScheme::from_iterm(&body) 206 | } else { 207 | ColorScheme::from_gogh(&body) 208 | } 209 | } 210 | } 211 | 212 | /// Sends an HTTP request and returns the body of the given request. 213 | /// 214 | /// Fails when the URL responds with non-200 status code. Also sends 215 | /// `colortty` as `User-Agent` header. 216 | async fn send_http_request(req: RequestBuilder) -> Result { 217 | let mut res = req 218 | .header("User-Agent", "colortty") 219 | .await 220 | // Surf::Error (http_types::Error) is not a std::error:Error. 221 | .map_err(|e| e.into_inner()) 222 | .context("Failed to send an HTTP request")?; 223 | 224 | if !res.status().is_success() { 225 | bail!("Received non-success status code: {}", res.status()); 226 | } 227 | 228 | let body = res 229 | .body_string() 230 | .await 231 | .map_err(|e| e.into_inner()) 232 | .context("Failed to read HTTP response body")?; 233 | return Ok(body); 234 | } 235 | -------------------------------------------------------------------------------- /tests/color.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod color_tests { 3 | mod color { 4 | use colortty::Color; 5 | 6 | #[test] 7 | fn from_mintty_color_works() { 8 | assert_eq!( 9 | Color::from_mintty_color("12,3,255").unwrap(), 10 | Color { 11 | red: 12, 12 | green: 3, 13 | blue: 255 14 | } 15 | ); 16 | } 17 | 18 | #[test] 19 | fn from_mintty_color_invalid_format() { 20 | assert!(Color::from_mintty_color("123").is_err()); 21 | } 22 | 23 | #[test] 24 | fn from_mintty_color_parse_int_error() { 25 | assert!(Color::from_mintty_color("abc,3,fo").is_err()); 26 | } 27 | 28 | #[test] 29 | fn to_hex() { 30 | assert_eq!( 31 | Color { 32 | red: 123, 33 | green: 4, 34 | blue: 255 35 | } 36 | .to_hex(), 37 | "0x7b04ff" 38 | ); 39 | } 40 | } 41 | 42 | mod color_scheme { 43 | use colortty::ColorScheme; 44 | use std::fs::File; 45 | use std::io::Read; 46 | 47 | fn read_fixture(filename: &str) -> String { 48 | let mut fixture = String::new(); 49 | File::open(filename) 50 | .unwrap() 51 | .read_to_string(&mut fixture) 52 | .unwrap(); 53 | return fixture; 54 | } 55 | 56 | #[test] 57 | fn convert_minttyrc() { 58 | let dracula_minttyrc = read_fixture("tests/fixtures/Dracula.minttyrc"); 59 | let dracula_alacritty: String = "colors: 60 | # Default colors 61 | primary: 62 | background: '0x282a36' 63 | foreground: '0xf8f8f2' 64 | 65 | # Normal colors 66 | normal: 67 | black: '0x000000' 68 | red: '0xff5555' 69 | green: '0x50fa7b' 70 | yellow: '0xf1fa8c' 71 | blue: '0xcaa9fa' 72 | magenta: '0xff79c6' 73 | cyan: '0x8be9fd' 74 | white: '0xbfbfbf' 75 | 76 | # Bright colors 77 | bright: 78 | black: '0x282a35' 79 | red: '0xff6e67' 80 | green: '0x5af78e' 81 | yellow: '0xf4f99d' 82 | blue: '0xcaa9fa' 83 | magenta: '0xff92d0' 84 | cyan: '0x9aedfe' 85 | white: '0xe6e6e6' 86 | " 87 | .to_string(); 88 | let scheme = ColorScheme::from_minttyrc(&dracula_minttyrc).unwrap(); 89 | assert_eq!(scheme.to_yaml(), dracula_alacritty); 90 | } 91 | 92 | #[test] 93 | fn convert_iterm() { 94 | let dracula_iterm = read_fixture("tests/fixtures/Dracula.itermcolors"); 95 | let dracula_alacritty: String = "colors: 96 | # Default colors 97 | primary: 98 | background: '0x1e1f28' 99 | foreground: '0xf8f8f2' 100 | 101 | # Cursor colors 102 | cursor: 103 | text: '0xffffff' 104 | cursor: '0xbbbbbb' 105 | 106 | # Normal colors 107 | normal: 108 | black: '0x000000' 109 | red: '0xff5555' 110 | green: '0x50fa7b' 111 | yellow: '0xf1fa8c' 112 | blue: '0xbd93f9' 113 | magenta: '0xff79c6' 114 | cyan: '0x8be9fd' 115 | white: '0xbbbbbb' 116 | 117 | # Bright colors 118 | bright: 119 | black: '0x555555' 120 | red: '0xff5555' 121 | green: '0x50fa7b' 122 | yellow: '0xf1fa8c' 123 | blue: '0xbd93f9' 124 | magenta: '0xff79c6' 125 | cyan: '0x8be9fd' 126 | white: '0xffffff' 127 | " 128 | .to_string(); 129 | let scheme = ColorScheme::from_iterm(&dracula_iterm).unwrap(); 130 | assert_eq!(scheme.to_yaml(), dracula_alacritty); 131 | } 132 | 133 | #[test] 134 | fn convert_iterm_complicated() { 135 | let firewatch_iterm = read_fixture("tests/fixtures/two-firewatch-light.itermcolors"); 136 | let scheme = ColorScheme::from_iterm(&firewatch_iterm).unwrap(); 137 | let firewatch_alacritty: String = "colors: 138 | # Default colors 139 | primary: 140 | background: '0xf8f6f2' 141 | foreground: '0x75541b' 142 | 143 | # Cursor colors 144 | cursor: 145 | text: '0xd5deff' 146 | cursor: '0xda4181' 147 | 148 | # Normal colors 149 | normal: 150 | black: '0x383a42' 151 | red: '0xe45649' 152 | green: '0x50a14f' 153 | yellow: '0xc18401' 154 | blue: '0x0184bc' 155 | magenta: '0xa626a4' 156 | cyan: '0x0997b3' 157 | white: '0xfafafa' 158 | 159 | # Bright colors 160 | bright: 161 | black: '0x4f525e' 162 | red: '0xe06c75' 163 | green: '0x98c379' 164 | yellow: '0xe5c07b' 165 | blue: '0x61afef' 166 | magenta: '0xc678dd' 167 | cyan: '0x56b6c2' 168 | white: '0xffffff' 169 | " 170 | .to_string(); 171 | assert_eq!(scheme.to_yaml(), firewatch_alacritty); 172 | } 173 | 174 | #[test] 175 | fn convert_gogh() { 176 | let dracula_gogh = read_fixture("tests/fixtures/dracula.sh"); 177 | let dracula_alacritty: String = "colors: 178 | # Default colors 179 | primary: 180 | background: '0x282a36' 181 | foreground: '0x94a3a5' 182 | 183 | # Normal colors 184 | normal: 185 | black: '0x44475a' 186 | red: '0xff5555' 187 | green: '0x50fa7b' 188 | yellow: '0xffb86c' 189 | blue: '0x8be9fd' 190 | magenta: '0xbd93f9' 191 | cyan: '0xff79c6' 192 | white: '0x94a3a5' 193 | 194 | # Bright colors 195 | bright: 196 | black: '0x000000' 197 | red: '0xff5555' 198 | green: '0x50fa7b' 199 | yellow: '0xffb86c' 200 | blue: '0x8be9fd' 201 | magenta: '0xbd93f9' 202 | cyan: '0xff79c6' 203 | white: '0xffffff' 204 | " 205 | .to_string(); 206 | let scheme = ColorScheme::from_gogh(&dracula_gogh).unwrap(); 207 | assert_eq!(scheme.to_yaml(), dracula_alacritty); 208 | } 209 | } 210 | } 211 | -------------------------------------------------------------------------------- /tests/fixtures/Dracula.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Blue Component 8 | 0.0 9 | Green Component 10 | 0.0 11 | Red Component 12 | 0.0 13 | 14 | Ansi 1 Color 15 | 16 | Blue Component 17 | 0.3333333432674408 18 | Green Component 19 | 0.3333333432674408 20 | Red Component 21 | 1 22 | 23 | Ansi 10 Color 24 | 25 | Blue Component 26 | 0.4823529411764706 27 | Green Component 28 | 0.98039215686274506 29 | Red Component 30 | 0.31372549019607843 31 | 32 | Ansi 11 Color 33 | 34 | Blue Component 35 | 0.5490196078431373 36 | Green Component 37 | 0.98039215686274506 38 | Red Component 39 | 0.94509803921568625 40 | 41 | Ansi 12 Color 42 | 43 | Blue Component 44 | 0.97647058823529409 45 | Green Component 46 | 0.57647058823529407 47 | Red Component 48 | 0.74117647058823533 49 | 50 | Ansi 13 Color 51 | 52 | Blue Component 53 | 0.77647058823529413 54 | Green Component 55 | 0.47450980392156861 56 | Red Component 57 | 1 58 | 59 | Ansi 14 Color 60 | 61 | Blue Component 62 | 0.99215686274509807 63 | Green Component 64 | 0.9137254901960784 65 | Red Component 66 | 0.54509803921568623 67 | 68 | Ansi 15 Color 69 | 70 | Blue Component 71 | 1 72 | Green Component 73 | 1 74 | Red Component 75 | 1 76 | 77 | Ansi 2 Color 78 | 79 | Blue Component 80 | 0.4823529411764706 81 | Green Component 82 | 0.98039215686274506 83 | Red Component 84 | 0.31372549019607843 85 | 86 | Ansi 3 Color 87 | 88 | Blue Component 89 | 0.5490196078431373 90 | Green Component 91 | 0.98039215686274506 92 | Red Component 93 | 0.94509803921568625 94 | 95 | Ansi 4 Color 96 | 97 | Blue Component 98 | 0.97647058823529409 99 | Green Component 100 | 0.57647058823529407 101 | Red Component 102 | 0.74117647058823533 103 | 104 | Ansi 5 Color 105 | 106 | Blue Component 107 | 0.77647058823529413 108 | Green Component 109 | 0.47450980392156861 110 | Red Component 111 | 1 112 | 113 | Ansi 6 Color 114 | 115 | Blue Component 116 | 0.99215686274509807 117 | Green Component 118 | 0.9137254901960784 119 | Red Component 120 | 0.54509803921568623 121 | 122 | Ansi 7 Color 123 | 124 | Blue Component 125 | 0.73333334922790527 126 | Green Component 127 | 0.73333334922790527 128 | Red Component 129 | 0.73333334922790527 130 | 131 | Ansi 8 Color 132 | 133 | Blue Component 134 | 0.33333333333333331 135 | Green Component 136 | 0.33333333333333331 137 | Red Component 138 | 0.33333333333333331 139 | 140 | Ansi 9 Color 141 | 142 | Blue Component 143 | 0.33333333333333331 144 | Green Component 145 | 0.33333333333333331 146 | Red Component 147 | 1 148 | 149 | Background Color 150 | 151 | Blue Component 152 | 0.15977837145328522 153 | Green Component 154 | 0.12215272337198257 155 | Red Component 156 | 0.11765811592340469 157 | 158 | Bold Color 159 | 160 | Blue Component 161 | 1 162 | Green Component 163 | 1 164 | Red Component 165 | 1 166 | 167 | Cursor Color 168 | 169 | Blue Component 170 | 0.73333334922790527 171 | Green Component 172 | 0.73333334922790527 173 | Red Component 174 | 0.73333334922790527 175 | 176 | Cursor Text Color 177 | 178 | Blue Component 179 | 1 180 | Green Component 181 | 1 182 | Red Component 183 | 1 184 | 185 | Foreground Color 186 | 187 | Blue Component 188 | 0.94901961088180542 189 | Green Component 190 | 0.97254902124404907 191 | Red Component 192 | 0.97254902124404907 193 | 194 | Selected Text Color 195 | 196 | Blue Component 197 | 1 198 | Green Component 199 | 1 200 | Red Component 201 | 1 202 | 203 | Selection Color 204 | 205 | Blue Component 206 | 0.35294118523597717 207 | Green Component 208 | 0.27843138575553894 209 | Red Component 210 | 0.26666668057441711 211 | 212 | 213 | -------------------------------------------------------------------------------- /tests/fixtures/Dracula.minttyrc: -------------------------------------------------------------------------------- 1 | ForegroundColour=248,248,242 2 | BackgroundColour=40,42,54 3 | Black=0,0,0 4 | BoldBlack=40,42,53 5 | Red=255,85,85 6 | BoldRed=255,110,103 7 | Green=80,250,123 8 | BoldGreen=90,247,142 9 | Yellow=241,250,140 10 | BoldYellow=244,249,157 11 | Blue=202,169,250 12 | BoldBlue=202,169,250 13 | Magenta=255,121,198 14 | BoldMagenta=255,146,208 15 | Cyan=139,233,253 16 | BoldCyan=154,237,254 17 | White=191,191,191 18 | BoldWhite=230,230,230 19 | -------------------------------------------------------------------------------- /tests/fixtures/dracula.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # ====================CONFIG THIS =============================== # 4 | export COLOR_01="#44475a" # HOST 5 | export COLOR_02="#ff5555" # SYNTAX_STRING 6 | export COLOR_03="#50fa7b" # COMMAND 7 | export COLOR_04="#ffb86c" # COMMAND_COLOR2 8 | export COLOR_05="#8be9fd" # PATH 9 | export COLOR_06="#bd93f9" # SYNTAX_VAR 10 | export COLOR_07="#ff79c6" # PROMP 11 | export COLOR_08="#94A3A5" # 12 | 13 | export COLOR_09="#000000" # 14 | export COLOR_10="#ff5555" # COMMAND_ERROR 15 | export COLOR_11="#50fa7b" # EXEC 16 | export COLOR_12="#ffb86c" # 17 | export COLOR_13="#8be9fd" # FOLDER 18 | export COLOR_14="#bd93f9" # 19 | export COLOR_15="#ff79c6" # 20 | export COLOR_16="#ffffff" # 21 | 22 | export BACKGROUND_COLOR="#282a36" # Background Color 23 | export FOREGROUND_COLOR="#94A3A5" # Text 24 | export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor 25 | export PROFILE_NAME="Dracula" 26 | # =============================================================== # 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | # =============================================================== # 35 | # | Apply Colors 36 | # ===============================================================|# 37 | SCRIPT_PATH="${SCRIPT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" 38 | PARENT_PATH="$(dirname "${SCRIPT_PATH}")" 39 | 40 | # Allow developer to change url to forked url for easier testing 41 | # IMPORTANT: Make sure you export this variable if your main shell is not bash 42 | BASE_URL=${BASE_URL:-"https://raw.githubusercontent.com/Gogh-Co/Gogh/master"} 43 | 44 | 45 | if [[ -e "${PARENT_PATH}/apply-colors.sh" ]]; then 46 | bash "${PARENT_PATH}/apply-colors.sh" 47 | else 48 | if [[ "$(uname)" = "Darwin" ]]; then 49 | # OSX ships with curl and ancient bash 50 | bash -c "$(curl -so- "${BASE_URL}/apply-colors.sh")" 51 | else 52 | # Linux ships with wget 53 | bash -c "$(wget -qO- "${BASE_URL}/apply-colors.sh")" 54 | fi 55 | fi 56 | -------------------------------------------------------------------------------- /tests/fixtures/two-firewatch-light.itermcolors: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ansi 0 Color 6 | 7 | Alpha Component 8 | 1 9 | Blue Component 10 | 0.25882354378700256 11 | Color Space 12 | Calibrated 13 | Green Component 14 | 0.22745098173618317 15 | Red Component 16 | 0.21960784494876862 17 | 18 | Ansi 1 Color 19 | 20 | Alpha Component 21 | 1 22 | Blue Component 23 | 0.28627452254295349 24 | Color Space 25 | Calibrated 26 | Green Component 27 | 0.33725491166114807 28 | Red Component 29 | 0.89411765336990356 30 | 31 | Ansi 10 Color 32 | 33 | Alpha Component 34 | 1 35 | Blue Component 36 | 0.47450980544090271 37 | Color Space 38 | Calibrated 39 | Green Component 40 | 0.76470589637756348 41 | Red Component 42 | 0.59607845544815063 43 | 44 | Ansi 11 Color 45 | 46 | Alpha Component 47 | 1 48 | Blue Component 49 | 0.48235294222831726 50 | Color Space 51 | Calibrated 52 | Green Component 53 | 0.75294119119644165 54 | Red Component 55 | 0.89803922176361084 56 | 57 | Ansi 12 Color 58 | 59 | Alpha Component 60 | 1 61 | Blue Component 62 | 0.93725490570068359 63 | Color Space 64 | Calibrated 65 | Green Component 66 | 0.68627452850341797 67 | Red Component 68 | 0.3803921639919281 69 | 70 | Ansi 13 Color 71 | 72 | Alpha Component 73 | 1 74 | Blue Component 75 | 0.86666667461395264 76 | Color Space 77 | Calibrated 78 | Green Component 79 | 0.47058823704719543 80 | Red Component 81 | 0.7764706015586853 82 | 83 | Ansi 14 Color 84 | 85 | Alpha Component 86 | 1 87 | Blue Component 88 | 0.7607843279838562 89 | Color Space 90 | Calibrated 91 | Green Component 92 | 0.7137255072593689 93 | Red Component 94 | 0.33725491166114807 95 | 96 | Ansi 15 Color 97 | 98 | Alpha Component 99 | 1 100 | Blue Component 101 | 1 102 | Color Space 103 | Calibrated 104 | Green Component 105 | 1 106 | Red Component 107 | 1 108 | 109 | Ansi 2 Color 110 | 111 | Alpha Component 112 | 1 113 | Blue Component 114 | 0.30980393290519714 115 | Color Space 116 | Calibrated 117 | Green Component 118 | 0.63137257099151611 119 | Red Component 120 | 0.31372550129890442 121 | 122 | Ansi 3 Color 123 | 124 | Alpha Component 125 | 1 126 | Blue Component 127 | 0.0039215688593685627 128 | Color Space 129 | Calibrated 130 | Green Component 131 | 0.51764708757400513 132 | Red Component 133 | 0.75686275959014893 134 | 135 | Ansi 4 Color 136 | 137 | Alpha Component 138 | 1 139 | Blue Component 140 | 0.73725491762161255 141 | Color Space 142 | Calibrated 143 | Green Component 144 | 0.51764708757400513 145 | Red Component 146 | 0.0039215688593685627 147 | 148 | Ansi 5 Color 149 | 150 | Alpha Component 151 | 1 152 | Blue Component 153 | 0.64313727617263794 154 | Color Space 155 | Calibrated 156 | Green Component 157 | 0.14901961386203766 158 | Red Component 159 | 0.65098041296005249 160 | 161 | Ansi 6 Color 162 | 163 | Alpha Component 164 | 1 165 | Blue Component 166 | 0.70196080207824707 167 | Color Space 168 | Calibrated 169 | Green Component 170 | 0.59215688705444336 171 | Red Component 172 | 0.035294119268655777 173 | 174 | Ansi 7 Color 175 | 176 | Alpha Component 177 | 1 178 | Blue Component 179 | 0.98039215803146362 180 | Color Space 181 | Calibrated 182 | Green Component 183 | 0.98039215803146362 184 | Red Component 185 | 0.98039215803146362 186 | 187 | Ansi 8 Color 188 | 189 | Alpha Component 190 | 1 191 | Blue Component 192 | 0.36862745881080627 193 | Color Space 194 | Calibrated 195 | Green Component 196 | 0.32156863808631897 197 | Red Component 198 | 0.30980393290519714 199 | 200 | Ansi 9 Color 201 | 202 | Alpha Component 203 | 1 204 | Blue Component 205 | 0.45882353186607361 206 | Color Space 207 | Calibrated 208 | Green Component 209 | 0.42352941632270813 210 | Red Component 211 | 0.87843137979507446 212 | 213 | Background Color 214 | 215 | Alpha Component 216 | 1 217 | Blue Component 218 | 0.95080453157424927 219 | Color Space 220 | Calibrated 221 | Green Component 222 | 0.9657360315322876 223 | Red Component 224 | 0.97508513927459717 225 | 226 | Badge Color 227 | 228 | Alpha Component 229 | 0.5 230 | Blue Component 231 | 0.0 232 | Color Space 233 | Calibrated 234 | Green Component 235 | 0.0 236 | Red Component 237 | 1 238 | 239 | Bold Color 240 | 241 | Alpha Component 242 | 1 243 | Blue Component 244 | 0.030110811814665794 245 | Color Space 246 | Calibrated 247 | Green Component 248 | 0.095684230327606201 249 | Red Component 250 | 0.13157323002815247 251 | 252 | Cursor Color 253 | 254 | Alpha Component 255 | 1 256 | Blue Component 257 | 0.509 258 | Color Space 259 | Calibrated 260 | Green Component 261 | 0.258 262 | Red Component 263 | 0.856 264 | 265 | Cursor Guide Color 266 | 267 | Alpha Component 268 | 0.25 269 | Blue Component 270 | 0.94117647409439087 271 | Color Space 272 | Calibrated 273 | Green Component 274 | 0.94117647409439087 275 | Red Component 276 | 0.94117647409439087 277 | 278 | Cursor Text Color 279 | 280 | Alpha Component 281 | 1 282 | Blue Component 283 | 1 284 | Color Space 285 | Calibrated 286 | Green Component 287 | 0.87115436792373657 288 | Red Component 289 | 0.83721178770065308 290 | 291 | Foreground Color 292 | 293 | Alpha Component 294 | 1 295 | Blue Component 296 | 0.10804367065429688 297 | Color Space 298 | Calibrated 299 | Green Component 300 | 0.33193746209144592 301 | Red Component 302 | 0.46039360761642456 303 | 304 | Link Color 305 | 306 | Alpha Component 307 | 1 308 | Blue Component 309 | 0.73725491762161255 310 | Color Space 311 | Calibrated 312 | Green Component 313 | 0.51764708757400513 314 | Red Component 315 | 0.0039215688593685627 316 | 317 | Selected Text Color 318 | 319 | Alpha Component 320 | 1 321 | Blue Component 322 | 0.25882354378700256 323 | Color Space 324 | Calibrated 325 | Green Component 326 | 0.22745098173618317 327 | Red Component 328 | 0.21960784494876862 329 | 330 | Selection Color 331 | 332 | Alpha Component 333 | 1 334 | Blue Component 335 | 0.7513200044631958 336 | Color Space 337 | Calibrated 338 | Green Component 339 | 0.83710873126983643 340 | Red Component 341 | 0.8724905252456665 342 | 343 | 344 | 345 | --------------------------------------------------------------------------------