Bibata-Original bitmaps

This commit is contained in:
ful1e5 2021-02-22 18:01:51 +05:30
parent e86dec5163
commit 89eba25a9d
4 changed files with 79 additions and 8 deletions

View file

@ -0,0 +1,40 @@
import { Colors } from "bibata-core/src/types";
interface Config {
themeName: string;
color: Colors;
}
const black = "#000000";
const white = "#FFFFFF";
const amber = "#FF8300";
const richBlack = "#001524";
const config: Config[] = [
{
themeName: "Bibata-Original-Amber",
color: {
base: amber,
outline: white,
watch: {
background: richBlack,
},
},
},
{
themeName: "Bibata-Original-Classic",
color: {
base: black,
outline: white,
},
},
{
themeName: "Bibata-Original-Ice",
color: {
base: white,
outline: black,
},
},
];
export { config };

View file

@ -1,8 +1,37 @@
import { main } from "bibata-core";
import path from "path";
const hmm = async () => {
main();
console.log("Bibata Original");
import { BitmapsGenerator, SVGHandler } from "bibata-core";
import { config } from "./config";
const root = path.resolve(__dirname, "../../../../");
const svgDir = path.resolve(root, "svg", "modern");
const main = async () => {
for (const { themeName, color } of config) {
console.log("=>", themeName);
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
const svg = new SVGHandler.SvgDirectoryParser(svgDir);
const png = new BitmapsGenerator(bitmapsDir);
const browser = await png.getBrowser();
for (let { key, content } of svg.getStatic()) {
console.log(" -> Saving", key, "...");
content = SVGHandler.colorSvg(content, color);
await png.generateStatic(browser, content, key);
}
for (let { key, content } of svg.getAnimated()) {
console.log(" -> Saving", key, "...");
content = SVGHandler.colorSvg(content, color);
await png.generateAnimated(browser, content, key);
}
await browser.close();
}
};
hmm();
main();