UNPKG

react-native-fiesta

Version:

A set of celebration animations powered by Skia. Engage more with your users by celebrating in your React Native application.

22 lines (21 loc) 615 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.colorsFromTheme = colorsFromTheme; var _array = require("./array"); function colorsFromTheme(theme, itemsToRender) { const newColors = []; let colorToPushIndex = 0; const randomisedColors = (0, _array.shuffleArray)(theme); new Array(itemsToRender).fill(0).map(() => { if (colorToPushIndex === randomisedColors.length - 1) { colorToPushIndex = 0; } else { colorToPushIndex++; } newColors.push(randomisedColors[colorToPushIndex]); }); return newColors; } //# sourceMappingURL=colors.js.map