🌈 all colors posiblity replace

This commit is contained in:
ful1e5 2020-08-15 19:38:03 +05:30
parent 0ce6f1420f
commit bd9c2abc7d

View file

@ -28,11 +28,8 @@ for (let [schema] of Object.entries(colorSchemes)) {
const schemaSvgsPath = path.resolve("./src/svg", schemaName);
if (fs.existsSync(schemaSvgsPath)) {
rimraf(schemaSvgsPath, function () {});
} else {
fs.mkdirSync(schemaSvgsPath);
}
if (fs.existsSync(schemaSvgsPath)) rimraf(schemaSvgsPath, function () {});
fs.mkdirSync(schemaSvgsPath);
// Resolve Paths for svg
const staticSvgs = staticCursors.map((svgFile: string) => {
@ -44,7 +41,11 @@ for (let [schema] of Object.entries(colorSchemes)) {
.readFileSync(path.resolve(rawSvgsDir, svgFile), "utf-8")
.toString();
content = content.replace("black", base).replace("white", outline);
content = content
.replace("black", base)
.replace("white", outline)
.replace("#000000", base)
.replace("#ffffff", outline);
// Writing new svg
fs.writeFileSync(filePath, content, "utf-8");