From 62e8aa501001eb50764590dc40e8d57acc9aec77 Mon Sep 17 00:00:00 2001 From: Jamy Golden Date: Sat, 7 Sep 2024 02:02:09 +0200 Subject: [PATCH] Add 16bit rgb context values for mustache templates --- CHANGELOG.md | 8 ++++++++ Cargo.lock | 4 ++-- THIRD_PARTY_LICENSES.md | 4 ++-- tinted-builder-rust/Cargo.toml | 4 ++-- tinted-builder/CHANGELOG.md | 7 +++++++ tinted-builder/Cargo.toml | 2 +- tinted-builder/src/template/base16.rs | 12 ++++++++++++ tinted-builder/tests/general.rs | 12 ++++++++++++ 8 files changed, 46 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6d9f1d..3487914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [0.11.0] - 2024-09-07 + +## Added + +- Add support for proposed 0.12.0 builder spec by adding 16bit rgb + colour variables to the mustache context + ## [0.10.1] - 2024-09-03 ## Fixed @@ -169,6 +176,7 @@ - `sync` subcommand support to sync with latest Tinted Theming schemes - `build` subcommand to trigger theme template build +[0.11.0]: https://github.com/tinted-theming/tinted-builder-rust/compare/v0.10.1...v0.11.0 [0.10.1]: https://github.com/tinted-theming/tinted-builder-rust/compare/v0.10.0...v0.10.1 [0.10.0]: https://github.com/tinted-theming/tinted-builder-rust/compare/v0.9.5...v0.10.0 [0.9.5]: https://github.com/tinted-theming/tinted-builder-rust/compare/v0.9.3...v0.9.5 diff --git a/Cargo.lock b/Cargo.lock index 799b797..7c06559 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "tinted-builder" -version = "0.6.0" +version = "0.7.0" dependencies = [ "anyhow", "clap", @@ -399,7 +399,7 @@ dependencies = [ [[package]] name = "tinted-builder-rust" -version = "0.10.1" +version = "0.11.0" dependencies = [ "anyhow", "clap", diff --git a/THIRD_PARTY_LICENSES.md b/THIRD_PARTY_LICENSES.md index c82800a..285080c 100644 --- a/THIRD_PARTY_LICENSES.md +++ b/THIRD_PARTY_LICENSES.md @@ -1683,8 +1683,8 @@ limitations under the License. #### Used by -- [tinted-builder 0.6.0](https://github.com/tinted-theming/tinted-builder-rust) -- [tinted-builder-rust 0.10.1](https://github.com/tinted-theming/tinted-builder-rust) +- [tinted-builder 0.7.0](https://github.com/tinted-theming/tinted-builder-rust) +- [tinted-builder-rust 0.11.0](https://github.com/tinted-theming/tinted-builder-rust) - [ribboncurls 0.2.1](https://github.com/tinted-theming/ribboncurls) ``` diff --git a/tinted-builder-rust/Cargo.toml b/tinted-builder-rust/Cargo.toml index 70d3617..11431d8 100644 --- a/tinted-builder-rust/Cargo.toml +++ b/tinted-builder-rust/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tinted-builder-rust" -version = "0.10.1" +version = "0.11.0" edition = "2021" authors = ["Jamy Golden ", "Tinted Theming "] license = "MIT OR Apache-2.0" @@ -24,7 +24,7 @@ strip-ansi-escapes = "0.2.0" [dependencies.tinted-builder] path = "../tinted-builder" -version = "0.6.0" +version = "0.7.0" [[bin]] name = "tinted-builder-rust" diff --git a/tinted-builder/CHANGELOG.md b/tinted-builder/CHANGELOG.md index c0a1fad..1059697 100644 --- a/tinted-builder/CHANGELOG.md +++ b/tinted-builder/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 0.7.0 - 2024-09-07 + +## Added + +- Add support for proposed 0.12.0 builder spec by adding 16bit rgb + colour variables to the mustache context + ## 0.6.0 - 2024-08-28 ## Added diff --git a/tinted-builder/Cargo.toml b/tinted-builder/Cargo.toml index 591c7c2..d09763d 100644 --- a/tinted-builder/Cargo.toml +++ b/tinted-builder/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tinted-builder" description = "A Tinted Theming template builder which uses yaml color schemes to generate theme files." -version = "0.6.0" +version = "0.7.0" edition = "2021" license = "MIT OR Apache-2.0" readme = "README.md" diff --git a/tinted-builder/src/template/base16.rs b/tinted-builder/src/template/base16.rs index 72c79a6..378967e 100644 --- a/tinted-builder/src/template/base16.rs +++ b/tinted-builder/src/template/base16.rs @@ -54,6 +54,18 @@ pub(crate) fn to_template_context(scheme: &Base16Scheme) -> HashMap Result<()> { Ok(()) } +#[test] +fn render_rgb16() -> Result<()> { + let template_source = "{{base0A-rgb16-r}} {{base0A-rgb16-g}} {{base0A-rgb16-b}}"; + let scheme = Scheme::Base16(serde_yaml::from_str(SCHEME_SILK_LIGHT)?); + let template = Template::new(template_source.to_string(), scheme); + + let output = template.render()?; + + assert_eq!(output, "53199 44461 9509"); + Ok(()) +} + #[test] fn render_dec() -> Result<()> { let template_source = "{{base0A-dec-r}} {{base0A-dec-g}} {{base0A-dec-b}}";