#color-palette #palette #image #wasm-bindings #color

auto-palette-wasm

🎨 auto-palette的WebAssembly绑定,允许它从图像中自动提取调色板

2个不稳定版本

0.5.0 2024年8月13日
0.4.0 2024年6月7日
0.3.0 2024年5月19日

#311 in WebAssembly

MIT 许可证

250KB
6K SLoC

auto-palette-wasm

A WebAssembly绑定,允许auto-palette从图像中自动提取调色板。

开发

运行单元测试

cargo nextest run --tests --package auto-palette-wasm

运行wasm-pack测试

使用Chrome在无头模式下运行wasm-pack测试

wasm-pack test --headless --chrome ./crates/auto-palette-wasm

使用Firefox在无头模式下运行wasm-pack测试

wasm-pack test --headless --firefox ./crates/auto-palette-wasm

[!TIP] 在运行测试之前,请确保安装最新版本的Chrome驱动程序Gecko驱动程序。如果您使用macOS,您可以使用Homebrew安装驱动程序

brew install chromedriver
brew install geckodriver

构建WebAssembly模块

wasm-pack build ./crates/auto-palette-wasm --release --target web

依赖关系

~3–4.5MB
~68K SLoC