Skip to content
SnejUgal edited this page Sep 16, 2017 · 7 revisions

Attheme-js is a little framework for working with .attheme files in JS.

What it supports

  • Signed ints as values of variables;
  • HEX shorthand (#rrggbb and #aarrggbb) as values of variables;
  • Images as a chat wallpaper.

Installing

For using with node.js, just run

npm install attheme-js

You can also download the script from the “Releases” tab

In Node.js

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

In browsers

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

Usage

// creating a theme
let themeContent =
      `windowBackgroundWhite=#e8f5e9
       actionBarDefault=-11751600`;
const theme = new Attheme(themeContent);

// changing its content
theme.chat_outBubble = {
  red: 76,
  green: 175,
  blue: 80,
  alpha: 192
};
theme.windowBackgroundGray.green = 230;

// getting the theme's content as text
themeContent = theme.asText();

Documentation

See the documentation here.

Helpful stuff

See stuff like correct file reading here.

Clone this wiki locally