3.0.0 • Published 5 months ago

pa-theme v3.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

Creates and edits Project Arrhythmia themes.

🏠 Homepage

Install

npm install pa-theme

Usage

import { Theme } from "pa-theme";
const { Theme } = require("pa-theme");

Creating a theme

You can create a theme:

  • With default colors
const theme = New Theme();
const theme = CreateTheme({
  name: "Theme name",
});
  • With specified colors
const theme = CreateTheme({
  gui: "#FFFFFF",
  background: "#7F7F7F",
});

Working with the theme

Setting the theme's properties

  • Theme's ID (MUST be a unique 6 digit numeric string)
theme.id = "573168";
  • You can also use a helper function
import { ThemeUtils } from "pa-theme";
// ...
theme.id = ThemeUtils.randomThemeId();
  • Setting other properties
theme.name = "Theme";
theme.gui = "#FFFFFF";
theme.objects = ["#ff0000", "#ffa200", "#bfff00" /* ... */];

Building the theme

You can convert the theme to a JSON string/object, then write it to a file.

const fs = require("fs");

fs.writeFileSync("theme.lst", theme.toString());

Reading the theme

You can read an existing theme from the string/object.

const fs = require("fs");

const jsonString = fs.readFileSync("theme.lst");
const json = JSON.parse(jsonString);
const theme = new Theme();
theme.fromJson(json);

🤝 Contributing

Contributions, issues and feature requests are welcome!Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

📝 License

Copyright © 2023 PA Toolkit. This project is MIT licensed.


This README was generated with ❤️ by readme-md-generator

3.0.0

5 months ago

2.2.1

2 years ago

2.2.0

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago