color-palettes

Crates.iocolor-palettes
lib.rscolor-palettes
version0.1.0
sourcesrc
created_at2024-10-07 16:42:31.42217
updated_at2024-10-07 16:42:31.42217
descriptionGenerate colors in a perceptually uniform color space.
homepage
repositoryhttps://github.com/erenyesilyurt/color-palettes
max_upload_size
id1400262
size20,519
Mehmet Eren Yeşilyurt (erenyesilyurt)

documentation

README

Color Palettes

Generate colors with a perceptually uniform distance between them.

use color_palettes::*;

fn main() {
    let num_colors = 16;
    let config = GeneratorConfig::default();
    let palette = generate_palette(num_colors, &config).unwrap();
    save_palette(&palette, "palette.png");
}

You can adjust the distance between subsequent colors in the palette by changing similarity:

    let mut config = GeneratorConfig::default();
    config.similarity = 0.8; // takes values between 0 and 1
    let palette = generate_palette(num_colors, &config).unwrap();
Commit count: 2

cargo fmt