{"id":47265049,"url":"https://github.com/razkar-studio/farben","last_synced_at":"2026-04-20T03:03:41.689Z","repository":{"id":344184527,"uuid":"1180722370","full_name":"razkar-studio/farben","owner":"razkar-studio","description":"Markup for the Terminal, but faster and safer. ","archived":false,"fork":false,"pushed_at":"2026-04-12T10:54:51.000Z","size":394,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-12T12:24:20.887Z","etag":null,"topics":["ansi","cli","color","coloring","colorization","colorize","crate","crates-io","lib","libraries","library","markup","rust","rust-cli","syntax","terminal"],"latest_commit_sha":null,"homepage":"https://razkar-studio.github.io/farben/","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/razkar-studio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-13T10:41:53.000Z","updated_at":"2026-04-12T10:54:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/razkar-studio/farben","commit_stats":null,"previous_names":["razkar-studio/farben"],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/razkar-studio/farben","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razkar-studio%2Ffarben","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razkar-studio%2Ffarben/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razkar-studio%2Ffarben/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razkar-studio%2Ffarben/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/razkar-studio","download_url":"https://codeload.github.com/razkar-studio/farben/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/razkar-studio%2Ffarben/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ansi","cli","color","coloring","colorization","colorize","crate","crates-io","lib","libraries","library","markup","rust","rust-cli","syntax","terminal"],"created_at":"2026-03-15T04:00:24.093Z","updated_at":"2026-04-20T03:03:41.682Z","avatar_url":"https://github.com/razkar-studio.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n![banner logo](farben/images/farben.png)\n\n### Markup for the Terminal\n\n[![Crates.io Version](https://img.shields.io/crates/v/farben)](https://crates.io/crates/farben)\n[![docs.rs](https://img.shields.io/docsrs/farben)](https://docs.rs/farben)\n[![License MIT](https://img.shields.io/crates/l/farben)](https://github.com/razkar-studio/farben/blob/main/LICENSE-MIT)\n[![License Apache-2.0](https://img.shields.io/crates/l/farben)](https://github.com/razkar-studio/farben/blob/main/LICENSE-APACHE)\n[![Crates.io Downloads](https://img.shields.io/crates/d/farben)](https://crates.io/crates/farben)\n[![GitHub Stars](https://img.shields.io/github/stars/razkar-studio/farben)](https://github.com/razkar-studio/farben/stargazers)\n[![GitHub Issues](https://img.shields.io/github/issues/razkar-studio/farben)](https://github.com/razkar-studio/farben/issues)\n[![GitHub Last Commit](https://img.shields.io/github/last-commit/razkar-studio/farben)](https://github.com/razkar-studio/farben/commits/main)\n[![Rust Edition](https://img.shields.io/badge/rust%20edition-2024-orange)](https://doc.rust-lang.org/edition-guide/rust-2024/)\n[![Deps.rs](https://deps.rs/repo/github/razkar-studio/farben/status.svg)](https://deps.rs/repo/github/razkar-studio/farben)\n[![Repo Size](https://img.shields.io/github/repo-size/razkar-studio/farben)](https://github.com/razkar-studio/farben)\n[![Maintenance](https://img.shields.io/badge/maintenance-actively--developed-brightgreen)](https://github.com/razkar-studio/farben)\n\n\u003c/div\u003e\n\n## What Is Farben\n\nFarben is a terminal styling library for Rust that uses markup syntax. Color your terminal without typing whatever the heck `\\x1b[31m` is.\n\n```rust\nuse farben::prelude::*;\n\ncprintln!(\"[bold red]Error:[/] something went wrong.\");\n```\n\n## Documentation\n\n- **User Guide**: [https://razkar-studio.github.io/farben](https://razkar-studio.github.io/farben)\n- **API Reference**: [https://docs.rs/farben](https://docs.rs/farben)\n- **News**: [https://razkar-studio.github.io/farben/news](https://razkar-studio.github.io/farben/news)\n- **Changelog**: [CHANGELOG.md](./CHANGELOG.md)\n\n\u003e [!NOTE]\n\u003e Pre-1.0 versions have iterated quickly. Most minor bumps reflect internal changes; the public macro API (`cprint!`, `cprintln!`, `style!`, etc.) has been stable since 0.10. Farben aims for 1.0 once the API fully stabilizes with complete features, or once I get bored developing it.\n\n## Install\n\n```bash\ncargo add farben\n```\n\nFor compile-time markup validation:\n\n```bash\ncargo add farben --features compile\n```\n\n## Usage\n\n### Default Features (Runtime)\n\n```rust\nuse farben::prelude::*;\n\nstyle!(\"error\", \"[bold underline red]\");\nstyle!(\"warn\",  \"[bold yellow]\");\n\ncprintln!(\"[error]error: [/]Something bad happened.\");\ncprintln!(\"[warn]warn: [/]This looks suspicious.\");\ncprintln!(\"[bg:blue fg:white]White on blue!\");\n\nlet name = \"Razkar\";\ncprintln!(\"[bold green]Hello, {}!\", name);\n\ncprintb!(\"[red]This bleeds \");\ncprintln!(\"into this.\");\n```\n\n### With the `compile` Feature\n\nThe same code, but markup is parsed and validated at compile time. Invalid markup becomes a compile error instead of a runtime panic.\n\n```rust\nuse farben::prelude::*;\n\ncprintln!(\"[bold underline red]error: [/]Something bad happened.\");\ncprintln!(\"[bg:blue fg:white]White on blue!\");\n\nlet name = \"Razkar\";\ncprintln!(\"[bold green]Hello, {}!\", name);\n\ncprintb!(\"[red]This bleeds \");\ncprintln!(\"into this.\");\n```\n\n## Features\n\n- **Markup-like Syntax**: Easy to read, easy to write, powerful when used.\n- **Zero Required Runtime Dependencies**: Only `farben-core` as a path dependency. Farben introduces no complicated dependency tree.\n- **Opt-in Compile-time Processing**: Validate and process markup at compile time with no runtime overhead, via the `compile` feature flag.\n- **Complete Toolkit**: Named colors, ANSI256, RGB, emphasis styles, style chaining, foreground and background support.\n- **Drop-in Print Macros**: `cprint!`, `cprintln!`, `cprintb!`, `cprintbln!` work just like `print!` and `println!` but with markup support. Writer variants (`cwrite!`, `cwriteln!`, `cwriteb!`, `cwritebln!`) work with any `Write` implementor.\n- **Stderr Variants**: All print macros have `e` variants (`ceprint!`, `ceprintln!`, etc.) that target stderr.\n- **Bleed Variants**: `cprintb!`, `cprintbln!`, `colorb()`, and `colorb!()` skip the trailing reset, letting styles carry forward across multiple calls.\n- **User-defined Styles**: Define your own tags with `style!()` that expand to any combination of supported tags.\n- **Custom Style Files**: Drop a `name.frb.toml` file in your project, write one line in `build.rs` and two in `main.rs`, and all styles from that file are registered.\n- **anstyle Interop**: Convert to and from `anstyle::Style` with the sugar of markup. See the docs for details.\n\n## Workspace\n\nFarben is a Cargo workspace. The main crate is what most users want, but the others are published independently for advanced use:\n\n| Crate | Purpose |\n|-------|---------|\n| [`farben`](https://crates.io/crates/farben) | Main user-facing crate. Macros, prelude, runtime entry points. |\n| [`farben-core`](https://crates.io/crates/farben-core) | Zero-dependency core. Lexer, parser, ANSI encoding, registry. |\n| [`farben-macros`](https://crates.io/crates/farben-macros) | Proc-macros powering the `compile` feature. |\n| [`farben-build`](https://crates.io/crates/farben-build) | Build script support for `.frb.toml` style files. |\n| [`farben-md`](https://crates.io/crates/farben-md) | Inline markdown rendering to ANSI. |\n\n## Syntax\n\nTags are written as `[tag]` and apply from that point forward. Multiple tags can be combined in a single bracket: `[bold red]`.\n\n\u003e [!WARNING]\n\u003e Spaces inside `ansi()` and `rgb()` are not supported at the moment.\n\n| Tag | Description |\n|-----|-------------|\n| `[red]`, `[blue]`, ... | Named colors (black, red, green, yellow, blue, magenta, cyan, white) |\n| `[fg:red]`, `[bg:red]` | Explicit foreground/background color, works with all color formats |\n| `[rgb(r,g,b)]` | 24-bit RGB color |\n| `[ansi(n)]` | 256-color palette index |\n| `[bold]`, `[italic]`, `[dim]`, `[underline]`, `[blink]`, `[strikethrough]` | Emphasis styles |\n| `[overline]`, `[reverse]`, `[invisible]`, `[rapid-blink]`, `[double-underline]` | Extended emphasis |\n| `[/]` | Reset all styles |\n| `[/red]`, `[/bold]` | Reset a specific style, leaving others active |\n| `\\[` | Escaped bracket, treated as literal `[` |\n| `[yourname]` | User-defined style registered via `style!()` |\n\n## Error Handling\n\n`color()` panics on invalid markup. For graceful error handling, use `try_color()`:\n\n```rust\nuse farben::try_color;\n\nmatch try_color(\"[invalid]oops\") {\n    Ok(s) =\u003e println!(\"{s}\"),\n    Err(e) =\u003e eprintln!(\"Error: {e}\"),\n}\n```\n\n## Known Limitations\n\nNone at the moment! :tada:\n\n## Contributing\n\nContributions are welcome. Feel free to open an issue or submit a Pull Request.\n\n## License\n\nLicensed under either of [MIT License](LICENSE-MIT) or [Apache License, Version 2.0](LICENSE-APACHE) at your option.\n\nCheers, RazkarStudio.\n© 2026 RazkarStudio.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazkar-studio%2Ffarben","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frazkar-studio%2Ffarben","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frazkar-studio%2Ffarben/lists"}