Crates.io | attheme |
lib.rs | attheme |
version | 0.3.0 |
source | src |
created_at | 2018-10-30 12:46:00.742823 |
updated_at | 2019-10-10 12:18:27.059216 |
description | A crate for parsing and serialization of .attheme files. |
homepage | |
repository | https://gitlab.com/SnejUgal/attheme-rs.git |
max_upload_size | |
id | 93587 |
size | 788,885 |
attheme-rs
A crate for working with .attheme
files. It has full support for the
.attheme
file format. In addition, it provides all default themes,
including setting custom accent colors, and a complete list of variables.
Should you have a problem or a question, feel free to file an issue on our GitLab repository.
Add this in your Cargo.toml
:
[dependencies]
attheme = "0.2"
use std::fs;
use attheme::{Attheme, Color};
let contents = fs::read("path/to.attheme");
let mut theme = Attheme::from_bytes(&contents[..]);
theme.variables.insert("divider".to_string(), Color::new(0, 0, 0, 0x10));
if theme.variables.get("chat_wallpaper".to_string().is_some() {
println!("The theme has a color wallpaper");
}
use std::fs;
use attheme::Attheme;
let contents = fs::read("path/to.attheme");
let theme = Attheme::from_bytes(&contents[..]);
if let Some(wallpaper) = theme.wallpaper {
fs::write("path/to/image.jpg", wallpaper);
}
See the documentation on docs.rs.