A bunch more theme stuff

This commit is contained in:
Gregory Schier
2024-05-22 23:14:53 -07:00
parent 4c5087659b
commit 56acec473b
61 changed files with 8374 additions and 530 deletions

View File

@@ -22,7 +22,15 @@ export class Color {
}
static transparent(): Color {
return new Color('rgba(0, 0, 0, 0.1)', 'light');
return new Color('rgb(0,0,0)', 'light').translucify(1);
}
static white(): Color {
return new Color('rgb(0,0,0)', 'light').lower(1);
}
static black(): Color {
return new Color('rgb(0,0,0)', 'light').lift(1);
}
private clone(): Color {
@@ -80,6 +88,10 @@ export class Color {
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
}
hex(): string {
return parseColor(this.css()).hex;
}
private _lighten(mod: number): Color {
const c = this.clone();
c.lightness = this.lightness + (100 - this.lightness) * mod;