/**
* Utility for generation gradients
* @param color Primary color of gradient
*/
const getGradientCss = (color: PreviewGradientColor) => {
// Colors for fonts
const BLACK_COLOR = "#222222";
const WHITE_COLOR = "#f8f8f8";
switch (color) {
case "red":
return `
background-image: linear-gradient(90deg, rgb(242, 132, 105) 0%, rgb(255, 82, 131) 100%);
color: ${WHITE_COLOR};
`;
case "pink":
return `
background-image: linear-gradient(45deg, rgba(255,191,217,1) 0%, rgba(194,255,193,1) 100%);
color: ${BLACK_COLOR};
`;
case "orange":
return `
background-image: linear-gradient(77deg, rgba(247,217,171,1) 0%, rgba(221,111,128,1) 100%);
color: ${WHITE_COLOR};
`;
case "black":
return `
background-image: linear-gradient(162deg, rgba(0,0,0,1) 0%, rgba(83,83,83,1) 100%);
color: ${WHITE_COLOR};
`;
case "purple":
return `
background-image: linear-gradient(90deg, #efd5ff 0%, #515ada 100%);
color: ${BLACK_COLOR};
`;
case "yellow":
return `
background-image: linear-gradient(143deg, rgba(255,239,145,1) 0%, rgba(181,255,143,1) 100%);
color: ${BLACK_COLOR};
`;
case "green":
return `
background-image: linear-gradient(45deg, rgba(145,173,255,1) 0%, rgba(145,255,143,1) 100%);
color: ${BLACK_COLOR};
`;
case "rainbow":
return `
background-image:
linear-gradient(
108.4deg,
rgba(250,236,190,1) 4.2%,
rgba(247,202,205,1) 30.7%,
rgba(255,186,233,1) 53.9%,
rgba(214,176,214,1) 73.9%,
rgba(148,195,231,1) 90.4%
);
color: ${BLACK_COLOR};
`;
default: // Blue
return `
background-image: linear-gradient(to right, #a8c0ff, #3f2b96);
color: ${WHITE_COLOR};
`;
}
};