Equidistant lightness distributions for swatches
- Dominant language
- JavaScript
- Stars
- 2.1k
- Forks
- 130
- PR merge metrics
- No merged PRs in 30d
Description
## Description
Allow the user to input a lowest and highest ratio (with additional possible ratios inbetween), and then choose a number of additional swatches to generate that will "fill in" the gaps.
For example: User inputs lightest color, darkest color, and primary color for a given scale. The ratios for these may be 1.2, 4.5, and 7. The user wants a palette of 9 total colors (including the three entered into Leonardo). The system should allow users to change total swatches (9) while retaining original color inputs ("locking" the three hex values/ratios), and adding equally distributed interpolated ratios between. In this example, the ratios (distributed but retaining original inputs) would be 1.2, 1.3, 1.56, 1.94, 2.47, 3.15, 4.5, 5.52, and 7
## Why do you need this feature?
Allows user to retain original design starting-point (I want these three colors) and interpolates values in a **non-destructive** way. Current methods of recreating this workflow result in only retaining the lowest and highest contrast values and redistributing all values inbetween.
## Additional context
Current, destructive way to accomplish this returns these colors:

When a mid-tone swatch is retained (eg at 4.5 contrast ratio), this would be the expected output:

### Considerations
This feature would enable designers to create _less equally distributed swatches_ overall. The example above illustrates the use case and expected result, however the output is not as evenly distributed.
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by locating the swatch-generation and contrast-ratio code, then verify that changing the total swatch count preserves the entered colors and ratios while filling the gaps with interpolated ratios as shown in the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- design, frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100