-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgenerate-samples.js
More file actions
65 lines (58 loc) · 2.04 KB
/
generate-samples.js
File metadata and controls
65 lines (58 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Generate sample icons for README
const { generateIcon } = require('./dist/index');
const crypto = require('crypto');
const fs = require('fs');
console.log('Generating sample icons for README...\n');
// Helper to create hash from string
function hashString(str) {
return crypto.createHash('md5').update(str).digest('hex');
}
// 1. Different compositions
console.log('Generating composition samples...');
const compositions = ['centered', 'radial', 'split', 'frame'];
compositions.forEach(comp => {
const icon = generateIcon(hashString(`composition-${comp}`), {
composition: comp,
colorScheme: 'vibrant',
shapeCount: 7
});
fs.writeFileSync(`samples/${comp}.svg`, icon);
console.log(`✓ samples/${comp}.svg`);
});
// 2. Different color schemes
console.log('\nGenerating color scheme samples...');
const schemes = ['pastel', 'vibrant', 'ocean', 'sunset', 'warm', 'cool'];
schemes.forEach(scheme => {
const icon = generateIcon(hashString(`scheme-${scheme}`), {
composition: 'centered',
colorScheme: scheme,
shapeCount: 7
});
fs.writeFileSync(`samples/scheme-${scheme}.svg`, icon);
console.log(`✓ samples/scheme-${scheme}.svg`);
});
// 3. Gradient examples
console.log('\nGenerating gradient samples...');
const icon = generateIcon(hashString('gradient-example'), {
composition: 'radial',
colorScheme: 'sunset',
useGradients: true,
shapeCount: 7
});
fs.writeFileSync('samples/gradient.svg', icon);
console.log('✓ samples/gradient.svg');
// 4. Individual shapes
console.log('\nGenerating shape samples...');
const shapes = ['circle', 'square', 'triangle', 'hexagon', 'diamond'];
shapes.forEach(shape => {
const icon = generateIcon(hashString(`shape-${shape}`), {
allowedShapes: [shape],
composition: 'centered',
colorScheme: 'cool',
shapeCount: 5
});
fs.writeFileSync(`samples/shape-${shape}.svg`, icon);
console.log(`✓ samples/shape-${shape}.svg`);
});
console.log('\n✅ All sample icons generated successfully!');
console.log(`\nTotal: ${compositions.length + schemes.length + 1 + shapes.length} icons`);