{"id":21809515,"url":"https://github.com/syaw0/term_tools","last_synced_at":"2025-10-08T00:31:08.700Z","repository":{"id":260414202,"uuid":"880106564","full_name":"Syaw0/term_tools","owner":"Syaw0","description":"Colorize Your Terminal with Term_Tools: A Rust-powered Formatting Tool ","archived":false,"fork":false,"pushed_at":"2024-11-12T06:48:55.000Z","size":37,"stargazers_count":12,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2024-11-27T13:24:05.651Z","etag":null,"topics":["cli","cli-style","rust","rust-cli","rust-crate","rust-lang","rust-terminal","terminal","terminal-style"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/term_tools","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Syaw0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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-10-29T05:57:23.000Z","updated_at":"2024-11-20T02:21:11.000Z","dependencies_parsed_at":"2024-11-09T15:47:51.481Z","dependency_job_id":null,"html_url":"https://github.com/Syaw0/term_tools","commit_stats":null,"previous_names":["syaw0/vitalux","syaw0/term_tools"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syaw0%2Fterm_tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syaw0%2Fterm_tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syaw0%2Fterm_tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Syaw0%2Fterm_tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Syaw0","download_url":"https://codeload.github.com/Syaw0/term_tools/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235665657,"owners_count":19026236,"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":["cli","cli-style","rust","rust-cli","rust-crate","rust-lang","rust-terminal","terminal","terminal-style"],"created_at":"2024-11-27T13:22:18.365Z","updated_at":"2025-10-08T00:31:03.420Z","avatar_url":"https://github.com/Syaw0.png","language":"Rust","readme":"# **term_tools: Rich API for Colorizing Terminal**\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/dynamic/toml?url=https%3A%2F%2Fraw.githubusercontent.com%2FSyaw0%2Fterm_tools%2Frefs%2Fheads%2Fdevelop%2FCargo.toml\u0026query=package.version\u0026label=Version\u0026color=red)](https://crates.io/term_tools)\n\n## **Overview**\n\nterm_tools is a Rust library that provides a rich API for colorizing terminal output. It allows you to create styled text strings with various colors, effects, and formatters.\n\n## **Features**\n\n- **Colors**: Supports 16 basic colors, 256 palette colors, and RGB colors.\n- **Effects**: Supports slow blink and rapid blink.\n- **Formatters**: Supports reset, bold, faint, italic, underline, and overline formatters.\n- **Easy to use**: Simple and intuitive API for creating styled text strings.\n\n## **Usage**\n\nTo use term_tools, simply add the following line to your `Cargo.toml` file:\n\n```toml\n[dependencies]\nterm_tools = \"0.1.0\"\n```\n\nThen, import the library in your Rust code:\n\n```rust\nuse term_tools::styled;\n```\n\nCreate a styled text string using the `styled` function:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .red()\n    .bold()\n    .underline()\n    .paint();\nprintln!(\"{}\", styled_text);\n```\n\n## **Sequence of Styles**\n\nThe sequence of styles is important when using the `fg` and `bg` methods. These methods set the foreground and background colors, respectively, for all subsequent styles.\n\nWhen you call `fg` or `bg`, all styles that come before it will be applied to the foreground or background, respectively.\n\nHere's an example:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .red() // applies to foreground\n    .fg() // sets foreground color to red\n    .blue() // applies to background\n    .bg() // sets background color to blue\n    .paint();\n```\n\nIn this example, the `red` style is applied to the foreground, and the `blue` style is applied to the background.\n\nif there is only one call of `fg` or `bg` whole colors applied that `PaintType` for example:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .red() // red color\n    .blue() // blue color\n    .bg() // apply background color\n    .magenta() // magenta color\n    .paint();\n```\n\nin this example `paint` method will apply the background color of all colors.\n\nif there is not any `fg` or `bg` call , the default paint type assume as `Foreground` for example:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .red() // red color\n    .blue() // blue color\n    .paint();\n```\n\nin this example the `paint` method will use foreground color of the colors.\n\n## **Examples**\n\nHere are some examples of using term_tools:\n\n- **Basic colors**:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .red()\n    .paint();\nprintln!(\"{}\", styled_text);\n```\n\n- **RGB colors**:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .rgb(255, 0, 0)\n    .paint();\nprintln!(\"{}\", styled_text);\n```\n\n- **Effects**:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .bold()\n    .underline()\n    .paint();\nprintln!(\"{}\", styled_text);\n```\n\n- **Formatters**:\n\n```rust\nlet styled_text = styled(\"Hello, World!\")\n    .reset()\n    .bold()\n    .paint();\nprintln!(\"{}\", styled_text);\n```\n\n## **License**\n\nterm_tools is licensed under the MIT License.\n\n## **Contributing**\n\nContributions are welcome If you'd like to contribute to term_tools, please fork the repository and submit a pull request.\n\nI hope this helps Let me know if you'd like me to make any changes.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyaw0%2Fterm_tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyaw0%2Fterm_tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyaw0%2Fterm_tools/lists"}