Created
December 24, 2022 08:40
-
-
Save NickersF/3ea95e682c9f4552b3234c89deb36281 to your computer and use it in GitHub Desktop.
Basic Color Generator Methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function generateStepNames(colorNamesArray: Array<string>, numOfSteps: number, baseColor: string) { | |
if (numOfSteps < 0 || numOfSteps > 10) { | |
return console.log("Invalid color step range provided."); | |
} | |
for (let index = 0; index < numOfSteps; index++) { | |
colorNamesArray.push("fe-" + baseColor + "-0" + index.toString()); | |
} | |
} | |
export function buildBackgroundColorElements(colorNamesArray: Array<string>, parentEl: string) { | |
for (let index = 0; index < colorNamesArray.length; index++) { | |
let $colorEls = $("<div class='color-demo-box fe-" + colorNamesArray[index] + "-bg'></div>") | |
$("#" + parentEl).append($colorEls); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment