# pa-theme

> Creates and edits Project Arrhythmia themes.

Latest version **3.0.0** (published 2023-12-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install pa-theme
pnpm add pa-theme
yarn add pa-theme
bun add pa-theme
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-12-19 |
| First published | 2022-04-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | enchart |
| Maintainers | enchart |
| Keywords | pa, project arrhythmia, theme |

## Links

- npm: https://www.npmjs.com/package/pa-theme
- Repository: https://github.com/PA-Toolkit/pa-theme
- Issues: https://github.com/PA-Toolkit/pa-theme/issues
- npm.io page: https://npm.io/package/pa-theme

## Dependencies (1)

- [pa-common](https://npm.io/package/pa-common.md) ^1.1.3

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 3.0.0 (latest) — 2023-12-19
- 2.2.1 — 2022-05-07
- 2.2.0 — 2022-05-06
- 2.1.0 — 2022-05-05
- 2.0.1 — 2022-05-05
- 2.0.0 — 2022-05-05
- 1.0.1 — 2022-04-08
- 1.0.0 — 2022-04-07

## README

<h1 align="center">Welcome to pa-theme 👋</h1>
<p>
  <a href="https://www.npmjs.com/package/pa-theme" target="_blank">
    <img alt="Version" src="https://img.shields.io/npm/v/pa-theme.svg">
  </a>
  <a href="https://github.com/enchart/pa-theme#readme" target="_blank">
    <img alt="Documentation" src="https://img.shields.io/badge/documentation-yes-brightgreen.svg" />
  </a>
  <a href="https://github.com/enchart/pa-theme/graphs/commit-activity" target="_blank">
    <img alt="Maintenance" src="https://img.shields.io/badge/Maintained%3F-yes-green.svg" />
  </a>
  <a href="https://github.com/enchart/pa-theme/blob/master/LICENSE" target="_blank">
    <img alt="License: MIT" src="https://img.shields.io/github/license/enchart/pa-theme" />
  </a>
</p>

> Creates and edits Project Arrhythmia themes.

### 🏠 [Homepage](https://github.com/enchart/pa-theme)

## Install

```sh
npm install pa-theme
```

## Usage

```js
import { Theme } from "pa-theme";
```

```js
const { Theme } = require("pa-theme");
```

### Creating a theme

You can create a theme:

- With default colors

```js
const theme = New Theme();
```

```js
const theme = CreateTheme({
  name: "Theme name",
});
```

- With specified colors

```js
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)

```js
theme.id = "573168";
```

- You can also use a helper function

```js
import { ThemeUtils } from "pa-theme";
// ...
theme.id = ThemeUtils.randomThemeId();
```

- Setting other properties

```js
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.

```js
const fs = require("fs");

fs.writeFileSync("theme.lst", theme.toString());
```

### Reading the theme

You can read an existing theme from the string/object.

```js
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!<br />Feel free to check [issues page](https://github.com/enchart/pa-theme/issues).

## Show your support

Give a ⭐️ if this project helped you!

## 📝 License

Copyright © 2023 [PA Toolkit](https://github.com/pa-toolkit).<br />
This project is [MIT](https://github.com/enchart/pa-theme/blob/master/LICENSE) licensed.

---

_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_

---
_Source: https://npm.io/package/pa-theme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
