rgb 0.8.53

`struct RGB/RGBA/etc.` for sharing pixels between crates + convenience methods for color manipulation. Allows no-copy high-level interoperability. Also adds common convenience methods and implements standard Rust traits to make `RGB`/`RGBA` pixels and slices first-class Rust objects.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use rgb::*;

// Run using: cargo run --features=serde --example serde

fn main() {
    let color = Rgb { r:255_u8, g:0, b:100 };
    println!("{}", serde_json::to_string(&color).unwrap());

    let color: Rgb<u8> = serde_json::from_str("{\"r\":10,\"g\":20,\"b\":30}").unwrap();
    println!("{}", color);
}