meshgrad
meshgrad copied to clipboard
Ability to add your own colors?
hey, you can provide your own initial color, the rest of them will be generated automatically (analogous and complementary):
const generateMeshGradient = (
length: number,
baseColor?: string,
hash?: number
) => {
const [bgColor, bgImage] = genStops(
length,
hexToHSL(baseColor) ? hexToHSL(baseColor) : undefined,
hash ? hash : undefined
);
return `background-color: ${bgColor}; background-image:${bgImage}`;
};
usage:
generateMeshGradient(6, #088F8F);
What if you want to provide all the colors it should use?