Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/inspirateur/leaf-sample
A Rust crate to iterate indefinitely over well spread points, similar to some leaf arrangement pattern in nature.
https://github.com/inspirateur/leaf-sample
color-picker low-discrepancy-sequence sampling
Last synced: 30 days ago
JSON representation
A Rust crate to iterate indefinitely over well spread points, similar to some leaf arrangement pattern in nature.
- Host: GitHub
- URL: https://github.com/inspirateur/leaf-sample
- Owner: Inspirateur
- License: unlicense
- Created: 2023-02-17T12:54:25.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T03:44:06.000Z (almost 2 years ago)
- Last Synced: 2024-12-20T01:37:18.940Z (about 1 month ago)
- Topics: color-picker, low-discrepancy-sequence, sampling
- Language: Rust
- Homepage: https://crates.io/crates/leaf-spread
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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
```rust
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/