{"id":15678909,"url":"https://github.com/bash/terminal-colorsaurus","last_synced_at":"2025-04-04T17:04:09.342Z","repository":{"id":217684731,"uuid":"744085291","full_name":"bash/terminal-colorsaurus","owner":"bash","description":"A library for answering the question «Is this terminal dark or light?» 🦕","archived":false,"fork":false,"pushed_at":"2025-01-24T12:27:43.000Z","size":1784,"stargazers_count":53,"open_issues_count":9,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-27T12:44:12.151Z","etag":null,"topics":["dark-mode","terminal","tty"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bash.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":null,"license":"license-apache.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-16T15:40:32.000Z","updated_at":"2025-03-21T17:56:08.000Z","dependencies_parsed_at":"2024-01-20T19:45:29.998Z","dependency_job_id":"2da6c5c0-8197-4c70-8ef8-78ad4752105c","html_url":"https://github.com/bash/terminal-colorsaurus","commit_stats":{"total_commits":277,"total_committers":4,"mean_commits":69.25,"dds":"0.010830324909747335","last_synced_commit":"1a4f7de606192b9fd90d97b4a7a42063ee173e53"},"previous_names":["bash/term-color","bash/terminal-colorsaurus"],"tags_count":22,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bash%2Fterminal-colorsaurus","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bash%2Fterminal-colorsaurus/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bash%2Fterminal-colorsaurus/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bash%2Fterminal-colorsaurus/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bash","download_url":"https://codeload.github.com/bash/terminal-colorsaurus/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247217174,"owners_count":20903008,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dark-mode","terminal","tty"],"created_at":"2024-10-03T16:25:22.180Z","updated_at":"2025-04-04T17:04:09.317Z","avatar_url":"https://github.com/bash.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# terminal-colorsaurus 🦕\n\n[![Docs](https://img.shields.io/docsrs/terminal-colorsaurus/latest)](https://docs.rs/terminal-colorsaurus)\n[![Crate Version](https://img.shields.io/crates/v/terminal-colorsaurus)](https://crates.io/crates/terminal-colorsaurus)\n\nA cross-platform library for determining the terminal's background and foreground color. \\\nIt answers the question *«Is this terminal dark or light?»*.\n\nWorks in all major terminals including Windows Terminal (starting with v1.22).\n\n## Example\n```rust,no_run\nuse terminal_colorsaurus::{color_scheme, QueryOptions, ColorScheme};\n\nmatch color_scheme(QueryOptions::default()).unwrap() {\n    ColorScheme::Dark =\u003e { /* ... */ },\n    ColorScheme::Light =\u003e { /* ... */ },\n}\n```\n\n## [Docs](https://docs.rs/terminal-colorsaurus)\n\n## Inspiration\nThis crate borrows ideas from many other projects. This list is by no means exhaustive.\n\n* [xterm-query]: Use `mio` to wait for the terminal's response with a timeout.\n* [termbg]: Lists a lot of terminals which served as a good starting point for me to test terminals as well.\n* [macOS doesn't like polling /dev/tty][macos-dev-tty] by Nathan Craddock\n* [This excellent answer on Stack Overflow][perceived-lightness] for determining the perceived lightness of a color.\n* [This comment in the Terminal WG](https://gitlab.freedesktop.org/terminal-wg/specifications/-/issues/8#note_151381) for the `DA1` trick\n  to easily detect terminals that don't support querying the colors with `OSC 10` / `OSC 11`.\n\n## License\nLicensed under either of\n\n* Apache License, Version 2.0\n  ([license-apache.txt](license-apache.txt) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n* MIT license\n  ([license-mit.txt](license-mit.txt) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n## Contribution\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\n[xterm-query]: https://github.com/Canop/xterm-query\n[termbg]: https://github.com/dalance/termbg\n[macos-dev-tty]: https://nathancraddock.com/blog/macos-dev-tty-polling/\n[perceived-lightness]: https://stackoverflow.com/a/56678483\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbash%2Fterminal-colorsaurus","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbash%2Fterminal-colorsaurus","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbash%2Fterminal-colorsaurus/lists"}