-
-
Notifications
You must be signed in to change notification settings - Fork 59
Open
Description
Hi! Absolutely love this library. I'm using it to auto generate tones for a color palette from a starting color using lch format. I'm running into issues with the fact that, say, adding 5 to the lightness of a color and then subtracting 5 does not produce the original color (I assume because of the way colord transitions through rgba). I'm wondering if there are currently any workarounds you can think of?
My general approach looks like this:
return shadeIndices.map((n) =>
colord({ l: l + lightnessTransformation(n), c: c + chromaTransformation(n), ...lch })
);Where shadeIndices is an array of integers representing tones like [-2, -1, 0, 1, 2]. And lch is the rest of the lch object, doesn't include l and c.
Then, I provide an option to shift the starting lightness up or down.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels