attheme-rs

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

Installing

Add this in your Cargo.toml:

toml [dependencies] attheme = "0.2"

Examples

Working with variables

```rs 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("chatwallpaper".to_string()) { println!("The theme has a color wallpaper"); } ```

Extracting a theme's wallpaper

```rs 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.