mirror of
https://github.com/ful1e5/Bibata_Cursor.git
synced 2025-05-24 20:14:29 -04:00
🌈 Colors config init
This commit is contained in:
parent
6c44d15642
commit
d7169a34b8
2 changed files with 59 additions and 25 deletions
40
bitmapper/packages/modern/src/config.ts
Normal file
40
bitmapper/packages/modern/src/config.ts
Normal 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-Modern-Amber",
|
||||
color: {
|
||||
base: amber,
|
||||
outline: white,
|
||||
watch: {
|
||||
background: richBlack,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
themeName: "Bibata-Modern-Classic",
|
||||
color: {
|
||||
base: black,
|
||||
outline: white,
|
||||
},
|
||||
},
|
||||
{
|
||||
themeName: "Bibata-Modern-Ice",
|
||||
color: {
|
||||
base: white,
|
||||
outline: black,
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export { config };
|
|
@ -1,39 +1,33 @@
|
|||
import path from "path";
|
||||
|
||||
import { BitmapsGenerator, SVGHandler } from "bibata-core";
|
||||
import { Colors } from "bibata-core/src/types";
|
||||
import { config } from "./config";
|
||||
|
||||
const root = path.resolve(__dirname, "../../../../");
|
||||
const svgDir = path.resolve(root, "svg", "modern");
|
||||
|
||||
const themeName = "Bibata-Modern";
|
||||
const bitmapsDir = path.resolve(root, "bitmaps", themeName);
|
||||
|
||||
const color: Colors = {
|
||||
base: "#000000",
|
||||
outline: "#FFFFFF",
|
||||
watch: {
|
||||
background: "#FFFFFF",
|
||||
},
|
||||
};
|
||||
|
||||
const main = async () => {
|
||||
const SVG = new SVGHandler.SvgDirectoryParser(svgDir);
|
||||
for (const { themeName, color } of config) {
|
||||
console.log("Preparing bitmaps of", 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()) {
|
||||
for (let { key, content } of svg.getStatic()) {
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateStatic(browser, content, key);
|
||||
}
|
||||
|
||||
for (let { key, content } of SVG.getAnimated()) {
|
||||
for (let { key, content } of svg.getAnimated()) {
|
||||
content = SVGHandler.colorSvg(content, color);
|
||||
await png.generateAnimated(browser, content, key);
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
}
|
||||
};
|
||||
|
||||
main();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue