MCPcopy Index your code
hub / github.com/kyechan99/capsule-render / generateAutoGradient

Function generateAutoGradient

utils/setting.ts:42–51  ·  view source on GitHub ↗
(
  fontColor: string | undefined,
  customColorList = "",
)

Source from the content-addressed store, hash-verified

40};
41
42export const generateAutoGradient = (
43 fontColor: string | undefined,
44 customColorList = "",
45) => {
46 if (customColorList !== "")
47 return generateSelectColor(gradient, fontColor, customColorList);
48
49 const auto = gradient[Math.floor(Math.random() * gradient.length)];
50 return [auto.color, fontColor ? fontColor : auto.text, auto.textBg];
51};
52
53export const generateAutoByTime = (queryColor: string, fontColor?: string) => {
54 if (queryColor === "timeAuto") return randomizedByTime(pallete, fontColor);

Callers 3

constructorFunction · 0.90
color.test.tsFile · 0.90
data.test.tsFile · 0.90

Calls 1

generateSelectColorFunction · 0.85

Tested by

no test coverage detected