This file contains hidden or 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
| function generateContrastingColors(baseColor, numberOfColors, minContrastRatio = 4.5) { | |
| const colors = []; | |
| let attempts = 0; | |
| const maxAttempts = numberOfColors * 100; | |
| while (colors.length < numberOfColors && attempts < maxAttempts) { | |
| const newColor = getRandomColor(); | |
| const contrastRatio = getContrastRatio(baseColor, newColor); | |
| if (contrastRatio >= minContrastRatio) { | |
| colors.push(newColor); |
This file contains hidden or 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
| #!/usr/bin/env node | |
| /** | |
| * # Preview what would be renamed (dry run) | |
| * node rename-jsx-files.mjs packages/components --dry-run | |
| * | |
| * # Actually rename files | |
| * node rename-jsx-files.mjs packages/components | |
| * | |
| * # Verbose mode to see all files processed | |
| * node rename-jsx-files.mjs packages/components --verbose |
OlderNewer