rgb 0.5.1

struct RGB for sharing pixels between crates

struct RGB for Rust

Rust is strongly typed and your RGB pixel is not compatible with my RGB pixel.

So let's all use mine :P

extern crate rgb;

let px = RGB{r:255_u8, g:0, b:100};
assert_eq!(px.as_bytes()[0], 255);

let px = RGB8::new(255, 0, 255);
let inverted = px.map(|ch| 255 - ch);

println!("{}", inverted); // rgb(0,255,0)

xkcd standards

About colorspaces

This crate is intentionally ignorant about flavors of RGB color spaces. Correct color management is a complex problem, and this crate aims to be the lowest common denominator.