{"id":29212071,"url":"https://github.com/tinted-theming/tinted-builder-rust","last_synced_at":"2026-03-08T05:32:09.550Z","repository":{"id":209745801,"uuid":"724697567","full_name":"tinted-theming/tinted-builder-rust","owner":"tinted-theming","description":" A base16 and base24 builder written in Rust, focused on convenience for template maintainers.","archived":false,"fork":false,"pushed_at":"2026-02-19T02:24:39.000Z","size":389,"stargazers_count":6,"open_issues_count":4,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-02-19T06:54:05.752Z","etag":null,"topics":["base16","base24","builder","cli","mustache","tinted-theming"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tinted-theming.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","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":"2023-11-28T15:58:37.000Z","updated_at":"2026-02-19T02:24:41.000Z","dependencies_parsed_at":"2023-11-29T00:26:15.445Z","dependency_job_id":"c51d233f-4331-4be2-9a4a-ee44101d8202","html_url":"https://github.com/tinted-theming/tinted-builder-rust","commit_stats":null,"previous_names":["tinted-theming/base16-builder-rust","tinted-theming/builder-rust"],"tags_count":29,"template":false,"template_full_name":null,"purl":"pkg:github/tinted-theming/tinted-builder-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinted-theming%2Ftinted-builder-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinted-theming%2Ftinted-builder-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinted-theming%2Ftinted-builder-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinted-theming%2Ftinted-builder-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinted-theming","download_url":"https://codeload.github.com/tinted-theming/tinted-builder-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinted-theming%2Ftinted-builder-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30246726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T00:58:18.660Z","status":"online","status_checked_at":"2026-03-08T02:00:06.215Z","response_time":56,"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":["base16","base24","builder","cli","mustache","tinted-theming"],"created_at":"2025-07-02T22:06:56.029Z","updated_at":"2026-03-08T05:32:09.537Z","avatar_url":"https://github.com/tinted-theming.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tinted-builder-rust\n\n[![Matrix Chat](https://img.shields.io/matrix/tinted-theming:matrix.org)](https://matrix.to/#/#tinted-theming:matrix.org)\n[![Crates.io](https://img.shields.io/crates/v/tinted-builder-rust.svg)](https://crates.io/crates/tinted-builder-rust)\n[![Tests](https://github.com/tinted-theming/tinted-builder-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/tinted-theming/tinted-builder-rust/actions/workflows/ci.yml)\n\nA builder for [base16] and [base24] templates using the `0.11.1` [builder\nspecification].\n\nThis repo contains a command-line tool, [tinted-builder-rust], to build\nbase16 and base24 templates. It is also contains a library crate,\n[tinted-builder], which you can use to directly build templates within\nyour own Rust application.\n\n## Table of Contents\n\n- [CLI](#cli)\n  - [Requirements](#requirements)\n  - [Installation](#installation)\n  - [Basic usage](#basic-usage)\n  - [Commands](#commands)\n  - [Flags](#flags)\n- [Builder specification](#builder-specification)\n- [Library](#library)\n  - [Library installation](#library-installation)\n  - [Library usage](#library-usage)\n- [Contributing](#contributing)\n- [License](#license)\n\n## CLI\n\n### Requirements\n\n`git` is required to be installed if using the `tinted-builder-rust sync`\nsubcommand.\n\n### Installation\n\n**Cargo**\n\n```sh\ncargo install tinted-builder-rust\n```\n\n**Homebrew**\n\n```sh\nbrew tap tinted-theming/tinted\nbrew install tinted-builder-rust\n```\n\n**Binaries**\n\nDownload the relevant binary from the [repository releases] page.\n\n### Basic Usage\n\n```sh\ntinted-builder-rust sync # To sync with latest schemes\ntinted-builder-rust build path/to/base16-template\n```\n\n## Commands\n\nThe following is a table of the available subcommands for the CLI tool (tinted-builder-rust), including the descriptions and any notable arguments.\n\n| Subcommand | Description                          | Arguments            | Example Usage                              | Flags |\n|------------|--------------------------------------|----------------------|--------------------------------------------|-------|\n| `sync`  | Installs and or updates latest schemes. | - | `tinted-builder-rust sync` | `--quiet` (silence stderr and stdout) |\n| `build` | Builds the themes of a template. | `template_path`: Path to template directory. | `tinted-builder-rust build ./path/to/base16-template` | `--quiet` (silence stderr and stdout), `--sync` (equivalent of running `tinted-builder-rust sync` before `tinted-builder-rust build`) |\n\n## Flags\n\n| Flag/Option       | Description                             | Applicable Subcommands | Default Value | Example Usage                             |\n|-------------------|-----------------------------------------|------------------------|---------------|-------------------------------------------|\n| `--schemes-dir` `-s`   | Path to one or more local schemes directories. Repeat this flag to include multiple directories. Used by `build` to find schemes and by `sync` to clone/pull into those paths. | `build`, `sync` | Defaults to `\u003cdata-dir\u003e/schemes` | `tinted-builder-rust build . -s /path/one -s /path/two` |\n| `--data-dir` `-d`   | Specifies a custom path for the data directory. | All | Linux: `$XDG_DATA_HOME/tinted-theming/tinted-builder-rust` or `~/.local/share`. MacOS: `~/Library/Application\\ Support/tinted-theming/tinted-builder-rust` | `tinted-builder-rust sync --data-dir /path/to/custom/data-dir` |\n| `--help` `-h`     | Displays help information for the subcommand. | All | - | `tinted-builder-rust --help`, `tinted-builder-rust build --help`, etc |\n| `--version` `-V`  | Shows the version of tinted-builder-rust. | All | - | `tinted-builder-rust --version` |\n\n## Builder specification\n\ntinted-builder-rust implements the `0.11.1` [builder specification]. This\nspecification details the scheme yaml format or schema as well as the\nvariables the builder should provide when rendering template mustache\nfile. Have a look at the [builder specification] document for more\ndetails.\n\n### Tinted8 support\n\nIn addition to Base16/Base24, this repository provides Tinted8 support in the\nlibrary crate and CLI. Tinted8 simplifies schemes into a small, consistent set\nof keys and lets builders derive variants and supplemental colors.\n\n- Supported specs: Tinted8 Styling `~0.1.0`, Tinted8 Builder `~0.1.0`.\n- UI keys use flat, kebab-case names (see below).\n\nExample minimal Tinted8 scheme (YAML):\n\n```\nscheme:\n  system: \"tinted8\"\n  system-version: \"0.1.0\"\n  author: \"User \u003cuser@example.com\u003e\"\n  name: \"Ayu Mirage\"\n  slug: \"ayu-mirage\"\nvariant: \"dark\"\npalette:\n  black:   \"#131721\"\n  red:     \"#f07178\"\n  green:   \"#b8cc52\"\n  yellow:  \"#ffb454\"\n  blue:    \"#59c2ff\"\n  magenta: \"#d2a6ff\"\n  cyan:    \"#95e6cb\"\n  white:   \"#e6e1cf\"\nui:\n  background.normal: \"#131721\"\n  foreground.normal: \"#e6e1cf\"\n```\n\nExample `templates/config.yaml` for a Tinted8 template:\n\n```\ndefault:\n  filename: \"output/{{ scheme-system }}-{{ scheme-slug }}.ext\"\n  supported-systems: [tinted8]\n  supports:\n    tinted8-styling: \"\u003e=0.1.0\"\n    tinted8-builder: \"\u003e=0.1.0\"\n```\n\nExample Mustache variables in a Tinted8 template:\n\n- `{{ scheme.name }}` — scheme name\n- `{{ scheme.slug }}` — scheme slug\n- `{{ palette.blue.bright.hex }}` — hex of blue bright variant (derived if missing)\n- `{{ ui.background.hex }}` — hex of the UI background color\n- `{{ syntax.string.hex }}` — hex for the default string color\n\nNotes:\n- The builder derives missing `dim/bright` variants and supplemental `gray`,\n  `orange`, and `brown` per the Tinted8 Builder spec.\n- Decimal channels are normalized 0–1 and available as strings at\n  `rgb`/`rgb16`/`dec` under each color (e.g. `palette.red.normal.dec.r`).\n\n### Error codes (high level)\n\nThe CLI returns structured error codes grouped by stage. See `specs/tinted8/builder.md` for details.\n\n- E1xx — Intake \u0026 System Validation (e.g., E001 invalid system, E110 unknown system)\n- E2xx — Spec Compatibility (E002/E003 version mismatches)\n- E3xx — Template Configuration (E300–E305 missing/invalid config or templates)\n- E4xx — Build-Time Selection (E400 no schemes found)\n\n## Library\n\nThis library exposes a `Scheme` and `Template` struct which you can\nuse to generate your own themes using [base16] and [base24] templates and\n`0.11.1` compliant base16 and base24 scheme files.\n\nInternally tinted-builder-rust uses [ribboncurls] to render the templates.\n\n### Library installation\n\n```sh\ncargo add tinted-builder-rust\n```\n\n### Library Usage\n\n```rust\nuse tinted_builder_rust::{Scheme, Template};\nuse std::fs::read_to_string;\n\nlet template_str = read_to_string(\"path/to/template.mustache\").unwrap();\nlet scheme_str = read_to_string(\"path/to/scheme.yml\").unwrap();\nlet scheme = Scheme::Base16(serde_yaml::from_str(\u0026scheme_str).unwrap());\nlet template = Template::new(template_str, scheme);\n\ntemplate\n    .render()\n    .unwrap();\n\n### Programmatic CLI usage (build helper)\n\nThe CLI crate also exposes a small helper to drive a template build from code:\n\n```rust\n// in Cargo.toml: tinted-builder-rust = { version = \"*\" }\n\nlet template_dir = std::path::PathBuf::from(\"/path/to/template\");\nlet schemes_dir = std::path::PathBuf::from(\"/path/to/schemes\");\n\n// Quiet output, returns Result\u003c(), anyhow::Error\u003e\nif let Err(err) = tinted_builder_rust::build(\u0026template_dir, \u0026schemes_dir, true) {\n    eprintln!(\"build failed: {err}\");\n}\n```\n\nCommon errors include E300/E301/E302 (missing tinted8 supports), E303 (missing mustache),\nE304 (invalid filename config), E305 (missing/invalid template config), and E400 (no schemes found).\n```\n\nThe Scheme struct is as follows:\n\n```rust\nuse std::collections::HashMap;\nuse tinted_builder::{SchemeSystem, SchemeVariant};\n\npub struct Scheme {\n    pub system: SchemeSystem,\n    pub name: String,\n    pub slug: String,\n    pub author: String,\n    pub description: Option\u003cString\u003e,\n    pub variant: SchemeVariant,\n    pub palette: HashMap\u003cString, Color\u003e,\n}\n\npub struct Color {\n    pub hex: (String, String, String),\n    pub rgb: (u8, u8, u8),\n    pub dec: (f32, f32, f32),\n}\n```\n\n`Template::new`\nThe `Template` struct simply sets the content provided to it via\n`Template::new`.\n\n`template.render_to_file(\u0026scheme)` takes the scheme and generates the\nvariables defined in the `0.11.1` [builder specification].\n\n## Contributing\n\nContributions are welcome! Have a look at [CONTRIBUTING.md] for more\ninformation.\n\n## License\n\ntinted-builder-rust falls under the [GPL-3.0] license. Have a look at the\n[LICENSE] file.\n\n[tinted-builder-rust]: tinted-builder-rust/README.md\n[tinted-builder]: tinted-builder/README.md\n[latest schemes repository]: https://github.com/tinted-theming/schemes\n[home repository]: https://github.com/tinted-theming/home\n[builder specification]: https://github.com/tinted-theming/home/blob/main/builder.md\n[tinted8 styling spec]: specs/tinted8/styling.md\n[tinted8 builder spec]: specs/tinted8/builder.md\n[base16]: https://github.com/tinted-theming/home/blob/main/styling.md\n[base24]: https://github.com/tinted-theming/base24/blob/master/styling.md\n[ribboncurls]: https://github.com/tinted-theming/ribboncurls\n[CONTRIBUTING.md]: CONTRIBUTING.md\n[repository releases]: https://github.com/tinted-theming/tinted-builder-rust/releases/latest\n[GPL-3.0]: https://github.com/IQAndreas/markdown-licenses/blob/master/gnu-gpl-v3.0.md\n[LICENSE]: ./LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinted-theming%2Ftinted-builder-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinted-theming%2Ftinted-builder-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinted-theming%2Ftinted-builder-rust/lists"}