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
//TODO: Implement hexToRgb | |
export const hexToRgb = (rgb:string) => { | |
const rgbComponents = extractComponents(rgb); | |
return {r: parseInt(rgbComponents.r, 16), | |
g: parseInt(rgbComponents.g, 16), | |
b: parseInt(rgbComponents.b, 16) | |
}; | |
} |
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
import { number, element } from "prop-types"; | |
/** | |
* Shuffle an array in place | |
* @param a Array to shuffle | |
*/ | |
function shuffleArray(a: any[]) { | |
// Iterate over the array | |
for (let i = a.length; i; i--) { | |
// Get next index |