diff --git a/src/Utils/index.ts b/src/Utils/index.ts index 8911b49..17c969f 100644 --- a/src/Utils/index.ts +++ b/src/Utils/index.ts @@ -7,22 +7,22 @@ const countDecimals = (value) => { const generateColorShades = ( colors: { [key: string]: string }, - options: { + options?: { keyList?: string[]; opacities?: number[]; outputType: "obj" | "cssVars"; } ) => { - const colorKeys = options.keyList - ? Object.keys(colors) - : Object.keys(colors).filter((key) => options.keyList?.includes(key)); + const colorKeys = options?.keyList + ? Object.keys(colors).filter((key) => options.keyList?.includes(key)) + : Object.keys(colors); const generatedColorShadesArr: object[] = []; colorKeys.forEach((key) => { const colorString = colors[key]; - const opacities = options.opacities + const opacities = options?.opacities ? options.opacities : [0.1, 0.25, 0.5, 0.75];