https://github.com/simple-color-palette/rust-package
A Rust implementation of the Simple Color Palette format — a minimal JSON-based file format for defining color palettes
https://github.com/simple-color-palette/rust-package
cargo-package color-palette rust rust-packages simple-color-palette
Last synced: 2 months ago
JSON representation
A Rust implementation of the Simple Color Palette format — a minimal JSON-based file format for defining color palettes
- Host: GitHub
- URL: https://github.com/simple-color-palette/rust-package
- Owner: simple-color-palette
- License: mit
- Created: 2025-04-18T11:45:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-11-08T06:57:17.000Z (7 months ago)
- Last Synced: 2025-11-08T08:26:10.854Z (7 months ago)
- Topics: cargo-package, color-palette, rust, rust-packages, simple-color-palette
- Language: Rust
- Homepage: https://docs.rs/simple-color-palette
- Size: 13.7 KB
- Stars: 21
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# simple-color-palette
> A Rust implementation of the [Simple Color Palette](https://simplecolorpalette.com) format — a minimal JSON-based file format for defining color palettes
*Feedback wanted on the API.*
## Install
```sh
cargo add simple-color-palette
```
## Usage
[API documentation](https://docs.rs/simple-color-palette)
```rust
use simple_color_palette::{ColorPalette, Color};
let palette = ColorPalette::new(
vec![
Color::new(1.0, 0.0, 0.0, None, Some("Red".into())),
Color::new(0.0, 1.0, 0.0, None, Some("Green".into())),
],
Some("Traffic Lights".into()),
);
let path = std::path::Path::new("Traffic Lights.color-palette");
// Save palette
palette.write_to_file(path);
// Load palette
let loadedPalette = ColorPalette::read_from_file(path);
```