adobe / leonardo

Generate colors based on a desired contrast ratio

Home Page:http://www.leonardocolor.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add sequential and diverging palettes

NateBaldwinDesign opened this issue · comments

Add support for sequential and diverging palettes.

Each type would need unique configs for setup. Sequential would need:

  • Shift input (exponential slider)
  • Clamping option (full black/white or only key colors)
  • Number of colors to output

Diverging would need:

  • Shift input
  • Clamping
  • Number inputs
  • Unique gradient & separate inputs for each side of the diverging scale

See branch: https://github.com/adobe/leonardo/blob/sequential-colors/packages/ui/src/index.js

Here is a prototype for sequential scale manipulation: https://codepen.io/NateBaldwinDesign/full/mdJqKpP

Features:

  1. Clamping color values to input only
  2. No clamping = adds black & white to color scale
  3. Correct lightness = implements Leonardo's current method of dynamic domains based on key color lightness values.
  4. No corrected lightness = simple implement by which each color is equally spaced in the domain range.

Current WIP on this branch fails tests by single hexidecimal values due to update in method for outputting colors (incrementally rather than using d3.range() function)