This commit is contained in:
syuilo
2018-09-27 22:25:10 +09:00
parent b032f78769
commit ef74653a4b
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);
}
}