#points #spaced #distribution #sampling #evenly

leaf-spread

A crate to iterate indefinitely over well spread points, similar to some leaf arrangement pattern in nature

3 releases

0.1.2 Mar 7, 2023
0.1.1 Mar 7, 2023
0.1.0 Feb 21, 2023

#3 in #spaced

Unlicense

5KB
72 lines

leaf-sample

A Rust crate to iterate indefinitely over well spread points, similar to some leaf arrangement pattern in nature.

Applications

Ideal for generating a variable amount of distinct colors.

Grid sample Poisson Disk Leaf sample
Iterate indefinitely
Random Looking
Fast

Usage

use leaf_spread::leaf_sample;
use palette::Hsv;

fn main() {
  for [hue, value] in leaf_sample!(0..360, 0.6..1.0).take(10) {
    let color = Hsv::new(hue, 0.8, value);
    // use the color however
  }
}

How ?

Golden ratio shenaningans from http://extremelearning.com.au/unreasonable-effectiveness-of-quasirandom-sequences/

No runtime deps