wip
This commit is contained in:
parent
b032f78769
commit
ef74653a4b
4 changed files with 23 additions and 21 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue