Skip to content

dphm/color-me-rusty

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color Me Rusty

A demonstration in Rust + WebAssembly to set the background color of a webpage

Recurse Center pill

Files

.
├── src
│   └── lib.rs
│   └── colors.rs
├── target
│   └── wasm32-unknown-unknown
│       └── release
│           └── color-me-rusty.wasm
├── color-me-rusty.gc.wasm
├── Cargo.lock
├── Cargo.toml
├── index.html
├── index.js
└── README.md

Setup

Installing the Rustup toolchain

$ curl https://sh.rustup.rs -sSf | sh

See also: The Rust Programming Language Book

Installing Rust Nightly

$ rustup toolchain install nightly

Updating Rust Nightly

$ rustup update

Installing the WebAssembly target

$ rustup target add wasm32-unknown-unknown --toolchain nightly

Installing wasm-gc

$ cargo install --git https://github.com/alexcrichton/wasm-gc

Compilation

Compiling Rust to WebAssembly

$ cargo +nightly build --target wasm32-unknown-unknown --release

Creating a smaller binary with wasm-gc

$ wasm-gc target/wasm32-unknown-unknown/release/color-me-rusty.wasm -o color-me-rusty.gc.wasm

Resources

Acknowledgements

Thank you to the following people for contributing ideas and enthusiasm and/or pairing with me!

About

Interpolate document background color with Rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published