Skip to content

Commit

Permalink
lib: Add serialize trait for scheme and color
Browse files Browse the repository at this point in the history
  • Loading branch information
JamyGolden committed Jun 18, 2024
1 parent db213d2 commit 0ce5062
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tinted-builder-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ strip-ansi-escapes = "0.2.0"

[dependencies.tinted-builder]
path = "../tinted-builder"
version = "0.4.1"
version = "0.4.2"

[[bin]]
name = "tinted-builder-rust"
Expand Down
7 changes: 6 additions & 1 deletion tinted-builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# Changelog

## 0.4.2 - 2024-06-18

## Fixed

- Implement `Serialize` trait for `Scheme` and `Color`

## 0.4.1 - 2024-06-15

## Fixed

- Implement `Display` trait for `Scheme` and `Color`
`Scheme` themselves.

## 0.4.0 - 2024-06-15

Expand Down
2 changes: 1 addition & 1 deletion tinted-builder/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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.4.1"
version = "0.4.2"
edition = "2021"
license = "MIT OR Apache-2.0"
readme = "README.md"
Expand Down
6 changes: 3 additions & 3 deletions tinted-builder/src/scheme.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
mod color;

use regex::Regex;
use serde::{Deserialize, Deserializer};
use serde::{Deserialize, Deserializer, Serialize};
use std::{collections::HashMap, fmt};

use crate::constants::{REQUIRED_BASE16_PALETTE_KEYS, REQUIRED_BASE24_PALETTE_KEYS};

pub use crate::scheme::color::Color;

#[derive(Deserialize)]
#[derive(Deserialize, Serialize)]
pub struct SchemeWrapper {
pub(crate) system: String,
pub(crate) name: String,
Expand All @@ -19,7 +19,7 @@ pub struct SchemeWrapper {
pub(crate) palette: HashMap<String, String>,
}

#[derive(Debug)]
#[derive(Debug, Serialize)]
pub struct Scheme {
pub system: String,
pub name: String,
Expand Down
3 changes: 2 additions & 1 deletion tinted-builder/src/scheme/color.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use serde::{Deserialize, Serialize};
use std::fmt;

use anyhow::{Context, Result};

#[derive(Debug, Clone)]
#[derive(Debug, Clone, Deserialize, Serialize)]
pub struct Color {
pub hex: (String, String, String),
pub rgb: (u8, u8, u8),
Expand Down

0 comments on commit 0ce5062

Please sign in to comment.