attheme 0.2.0

A Rust crate for parsing and serialization of .attheme files.
Documentation

attheme-rs

A Rust crate for parsing and serialization of .attheme files.

Installing

Add this in your Cargo.toml:

[dependencies]
attheme = "0.1.0"

Examples

Working with variables

extern crate attheme;

use std::fs;
use attheme::Attheme;

let contents = fs::read("path/to.attheme");
let mut theme = Attheme::from_bytes(&contents[..]);

theme.variables.insert("divider".to_string(), [0, 0, 0, 0x10]);

if let Some(_) = theme.variables.get("chat_wallpaper".to_string()) {
  println!("The theme has a color wallpaper");
}

Extracting a theme's wallpaper

extern crate attheme;

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);
}

Documentation

See the documentation on docs.rs.