#color-palette #random #minimalist #generate #rgb #f32 #ranging

colourado

A small and minimalistic library to generate a random color palette

3 unstable releases

0.2.0 Jan 26, 2019
0.1.1 Jan 25, 2019
0.1.0 Jan 25, 2019

#33 in #f32

Download history 85/week @ 2024-04-01 19/week @ 2024-04-08 33/week @ 2024-04-15 37/week @ 2024-04-22 23/week @ 2024-04-29 25/week @ 2024-05-06 49/week @ 2024-05-13 41/week @ 2024-05-20 21/week @ 2024-05-27 23/week @ 2024-06-03 15/week @ 2024-06-10 24/week @ 2024-06-17 22/week @ 2024-06-24 11/week @ 2024-07-08 16/week @ 2024-07-15

53 downloads per month
Used in 2 crates

MIT license

10KB
163 lines

Colourado

A small and minimalistic library to generate a random color palette.
The user-facing Color struct contains RGB colors ranging from 0 to 1.
All colors are of type f32 (no exceptions).

Usage

use colourado::{Color, ColorPalette, PaletteType};

let palette = ColorPalette::new(4, PaletteType::Random, false);
let random_color = palette.colors[0].red;
let color_array: [f32; 3] = palette.colors[1].to_array();
let hue = 315.0;
let saturation = 0.5;
let value = 0.3;
let rgb_color: Color = Color::hsv_to_rgb(hue, saturation, value);

Example

A color palette might look like this when rendered:

Example image

Test the color palettes for yourself by running
cargo run --example preview TYPE NUM adjacent|spread
TYPE can be one of random, pastel, or dark NUM is the amount of colors to generate and display adjacent or spread determine whether the colors are generated close to each other or spread apart.

Dependencies

~560–780KB
~10K SLoC