Class: ColorThemeService
molecule.ColorThemeService
Hierarchy
↳
ColorThemeService
Implements
Constructors
constructor
• new ColorThemeService()
Overrides
Defined in
services/theme/colorThemeService.ts:101
Properties
colorTheme
• Private colorTheme: IColorTheme = BuiltInColorTheme
Defined in
services/theme/colorThemeService.ts:99
colorThemes
• Private colorThemes: IColorTheme[]
Defined in
services/theme/colorThemeService.ts:98
Methods
addThemes
▸ addThemes(themes): void
Add themes into colorThemes
This will update the duplicated themes found in colorThemes
Parameters
| Name | Type |
|---|---|
themes | IColorTheme | IColorTheme[] |
Returns
void
Implementation of
Defined in
services/theme/colorThemeService.ts:108
count
▸ count(name): number
Count the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Event name |
Returns
number
Inherited from
Defined in
emit
▸ emit(name, ...args): void
Emit the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | Event name |
...args | any | Arguments |
Returns
void
Inherited from
Defined in
getColorTheme
▸ getColorTheme(): IColorTheme
Get the current Color Theme
Returns
Implementation of
IColorThemeService.getColorTheme
Defined in
services/theme/colorThemeService.ts:149
getColorThemeMode
▸ getColorThemeMode(): ColorThemeMode
Get the mode('dark' or 'light') of the current Color Theme
Returns
Implementation of
IColorThemeService.getColorThemeMode
Defined in
services/theme/colorThemeService.ts:191
getThemeById
▸ getThemeById(id): undefined | IColorTheme
Get specific theme via id
Parameters
| Name | Type |
|---|---|
id | string |
Returns
undefined | IColorTheme
Implementation of
IColorThemeService.getThemeById
Defined in
services/theme/colorThemeService.ts:144
getThemes
▸ getThemes(): IColorTheme[]
Get all themes in colorThemes
Returns
Implementation of
Defined in
services/theme/colorThemeService.ts:178
onChange
▸ onChange(callback): void
Listen to the theme changed event
Parameters
| Name | Type |
|---|---|
callback | (prev: IColorTheme, next: IColorTheme, themeMode: ColorThemeMode) => void |
Returns
void
Implementation of
Defined in
services/theme/colorThemeService.ts:214
reload
▸ reload(): void
Reload current theme
Returns
void
Implementation of
Defined in
services/theme/colorThemeService.ts:182
reset
▸ reset(): void
Reset theme
Returns
void
Implementation of
Defined in
services/theme/colorThemeService.ts:186
setTheme
▸ setTheme(id): void
Set the current Color Theme via id,
Please ensure the theme could be found in colorThemes
Parameters
| Name | Type |
|---|---|
id | string |
Returns
void
Implementation of
Defined in
services/theme/colorThemeService.ts:153
subscribe
▸ subscribe(name, listener): void
Subscribe the service event
Parameters
| Name | Type | Description |
|---|---|---|
name | string | string[] | Event name |
listener | Function | Listener function |
Returns
void
Inherited from
Defined in
unsubscribe
▸ unsubscribe(name, listener?): void
Unsubscribe the specific event and the listener function
Parameters
| Name | Type | Description |
|---|---|---|
name | any | The event name |
listener? | Function | optional, it unsubscribes events via name if not pass the listener function |
Returns
void
Inherited from
Defined in
updateTheme
▸ updateTheme(theme): void
Update specific theme,
Parameters
| Name | Type |
|---|---|
theme | IColorTheme |
Returns
void
Implementation of
IColorThemeService.updateTheme