This commit is contained in:
syuilo 2018-09-27 22:25:10 +09:00
parent b032f78769
commit ef74653a4b
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
4 changed files with 23 additions and 21 deletions

View file

@ -43,12 +43,13 @@ function compile(theme: Theme): { [key: string]: string } {
if (code[0] == ':') {
const parts = code.split('<');
const func = parts.shift().substr(1);
const arg = parseInt(parts.shift(), 10);
const arg = parseFloat(parts.shift());
const color = getColor(parts.join('<'));
switch (func) {
case 'darken': return color.darken(arg);
case 'lighten': return color.lighten(arg);
case 'alpha': return color.setAlpha(arg);
}
}