Q-Apps-Utils/Numbers/Colors.ts
2023-10-09 12:44:15 -06:00

8 lines
206 B
TypeScript

import * as colorsys from "colorsys";
export const changeLightness = (hexColor: string, amount: number) => {
const hsl = colorsys.hex2Hsl(hexColor);
hsl.l += amount;
return colorsys.hsl2Hex(hsl);
};