Skip to content

A little framework for working with .attheme files in JS

Notifications You must be signed in to change notification settings

danicotra/attheme-js

 
 

Repository files navigation

attheme-js

A small framework for working with .attheme files in JS.

Supports

  • Signed int as a variable value;
  • Hex (#rrggbb and #aarrggbb) as a variable value;
  • Image wallpapers.

Installing

You can either install attheme-js package from npm:

npm install --save attheme-js

or download the framework from the “Releases” section.

Node.js

Require the attheme-js module:

const Attheme = require("attheme-js");

Browsers

Add a new <script> tag to your HTML:

<script src="path/to/attheme.min.js"></script>

If you install the framework from npm, the path is node_modules/attheme-js/dist/attheme.min.js.

Usage

Creating an empty theme

const emptyTheme = new Attheme();

Creating a theme with an uploaded file's content

const themeContent =
        `windowbackgroundWhite=#012226
         actionBarDefault=-3047847`;
const theme = new Attheme(themeContent);

Changing theme's data

theme.actionBarDefaultIcon = {
  red: 76,
  blue: 175,
  green: 80,
  alpha: 128
};
theme.actionBarDefault.red = 244;

Get the theme's content for saving

const themeContent = theme.asText();
/*
windowBackgroundWhite=#012226
actionBarDefault=#d17e59

*/

Getting theme's wallapeper

const themeWallpaper = theme[Attheme.IMAGE_KEY];

Documentatiom

See the documentation here.

Helpful stuff

About

A little framework for working with .attheme files in JS

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%