Files
zitadel/console/src/app/services/theme.service.ts
T
Max PeintnerandGitHub c8dc14ca9d fix(console): dont apply colors from branding settings (#6853)
fix: dont apply colors in console, clean up theme service
2023-11-02 06:41:36 +00:00

34 lines
778 B
TypeScript

import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
declare const tinycolor: any;
export interface Color {
name: string;
hex: string;
rgb: string;
contrastColor: string;
}
@Injectable()
export class ThemeService {
private _darkTheme: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(true);
public isDarkTheme: Observable<boolean> = this._darkTheme.asObservable();
public loading: boolean = false;
constructor() {
const theme = localStorage.getItem('theme');
if (theme) {
if (theme === 'light-theme') {
this.setDarkTheme(false);
} else {
this.setDarkTheme(true);
}
}
}
setDarkTheme(isDarkTheme: boolean): void {
this._darkTheme.next(isDarkTheme);
}
}