chore: add svg transformation task

This commit is contained in:
Mattia Astorino 2017-02-04 14:27:04 +01:00
parent 53f35715d2
commit dcd9548d8f
12 changed files with 33 additions and 32 deletions

View file

@ -12,11 +12,21 @@ import del from 'del';
import iconsColors from '../../icons/colors.js';
console.log(iconsColors);
Gulp.task('process:icons', () => {
del([`${Paths.icons}/svg/*.svg`]).then(paths => {
console.log('[ ⚙️ Deleting all icons]\n'.bold.red);
console.log('[ 🔥 Deleting all icons]\n'.bold.red);
});
Gulp.src(`${Paths.src}/icons/*.svg`)
.pipe(Colorize(iconsColors))
.pipe(Colorize({
colors: iconsColors,
replaceColor: function (content, hex) {
return content.replace('#000', '#' + hex);
},
replacePath: function (path, colorKey) {
return path.replace(/\.svg/, '.svg');
}
}))
.pipe(Gulp.dest(`${Paths.icons}/svg`));
});

View file

@ -1,34 +1,25 @@
const iconsColors ={
colors: {
// Specific files
actionscript: {
pink: 'FF00FF'
}
},
replaceColor: function (content, hex) {
return content.replace('#000', '#' + hex);
},
replacePath: function (path, colorKey) {
return path.replace(/\.svg/, '.svg');
/* Color Palette:
* green: '90A959',
* blue: '6A9FB5',
* blueDesaturated: '78909C',
* red: 'AC4142',
* redLight: 'D14748',
* maroon: 'AB7558',
* limeGreen: 'B8E15E',
* greenTea: '2ECC71',
* purple: 'AA759F',
* purpleDark: '8251A8',
* yellow: 'F4BF75',
* teal: '80CBC4',
* orange: 'D28445',
*/
var iconsColors = {
actionscript: {
pink: 'FF00FF'
}
}
/*
default: {
green: '90A959',
blue: '6A9FB5',
blueDesaturated: '78909C',
red: 'AC4142',
redLight: 'D14748',
maroon: 'AB7558',
limeGreen: 'B8E15E',
greenTea: '2ECC71',
purple: 'AA759F',
purpleDark: '8251A8',
yellow: 'F4BF75',
teal: '80CBC4',
orange: 'D28445',
}
*/
export default iconsColors;

View file

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 415 B

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 430 B

After

Width:  |  Height:  |  Size: 430 B

View file

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 624 B

View file

Before

Width:  |  Height:  |  Size: 733 B

After

Width:  |  Height:  |  Size: 733 B

View file

Before

Width:  |  Height:  |  Size: 518 B

After

Width:  |  Height:  |  Size: 518 B

View file

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 502 B

View file

Before

Width:  |  Height:  |  Size: 5 KiB

After

Width:  |  Height:  |  Size: 5 KiB