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

Function generateAutoColor

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

Source from the content-addressed store, hash-verified

28};
29
30export const generateAutoColor = (
31 fontColor: string | undefined,
32 customColorList = "",
33) => {
34 if (customColorList !== "")
35 return generateSelectColor(pallete, fontColor, customColorList);
36
37 const idx = Math.floor(Math.random() * pallete.length);
38 const auto = pallete[idx];
39 return [auto.color, fontColor ? fontColor : auto.text, auto.textBg];
40};
41
42export const generateAutoGradient = (
43 fontColor: string | undefined,

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