ectoplasm 0.1.0

Library to draw on https://ghost.life
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use ectoplasm::tokio;
use ectoplasm::url::Url;
use ectoplasm::RemoteCanvas;

#[tokio::main]
async fn main() {
    let server_url = Url::parse("wss://ghost.life").unwrap();
    let mut remote_canvas = RemoteCanvas::new(server_url).await.unwrap();
    remote_canvas.fetch().await;
    for y in 0..=255 {
        for x in 0..=255 {
            let c = remote_canvas.get_pixel(x, y).await;
            remote_canvas.set_pixel(x, y, 255 - c).await;
        }
    }
}