← back to roto on ba3a.dev

RampSuggester

Suggests ramps for a Palette: a deterministic starting point the artist then edits.

Colours below NEUTRAL_CHROMA form one neutral group; the rest fall into HUE_BUCKETS equal slices of the OKLab hue circle, starting at the +a axis. Each group is sorted dark to light. Of colours with exactly equal lightness, the one listed first in the palette stays, so every ramp passes Ramp validation. Empty groups are dropped. Groups are named ramp1, ramp2, ... in hue order, the neutral group last.

Properties

Link copied to clipboard
const val HUE_BUCKETS: Int = 6

The number of equal hue slices colours are grouped into.

Link copied to clipboard
const val NEUTRAL_CHROMA: Double = 0.03

The OKLab chroma below which a colour counts as neutral.

Functions

Link copied to clipboard
fun suggest(palette: Palette): List<Ramp>

The suggested ramps for palette, in hue order with the neutral ramp last.