tgxtheme-js
v0.1.1
Published
A small package for working with .tgx-theme files in JavaScript.
Downloads
8
Maintainers
Readme
tgxtheme-js
A package for working with .tgx-theme files in JavaScript. It fully supports the .tgx-theme format.
Installing
npm i tgxtheme-js
Usage
import TgxTheme from "tgxtheme-js";
const theme = new TgxTheme(`
!
name: "TgxTheme"
author: "tgxtheme_js"
@
parentTheme: 11
#
text: #000000
textLinkPressHighlight: #ffffff
unread: #123456
`);
console.log(theme.getVariable(`text`)); // { red: 0, green: 0, blue: 0, alpha: 255 }
theme.setVariable(`textLinkPressHighlight`, {
red: 255,
green: 146,
blue: 13,
alpha: 7,
});
console.log(theme.getVariable(`textLinkPressHighlight`)); // { red: 255, green: 146, blue: 13, alpha: 7 }
console.log(theme.toString()); /*
!
name: "TgxTheme"
author: "tgxtheme_js"
@
parentTheme: 11
#
text: #000000
textLinkPressHighlight: #FF920D07
unread: #123456
*/