Skip to main content

Interface: IColorThemeService

services.IColorThemeService

Table of contents

Methods

Methods

addThemes

addThemes(themes): void

Add themes into colorThemes

This will update the duplicated themes found in colorThemes

Parameters

NameType
themesIColorTheme | IColorTheme[]

Returns

void

Defined in

src/services/theme/colorThemeService.ts:18


getColorTheme

getColorTheme(): IColorTheme

Get the current Color Theme

Returns

IColorTheme

Defined in

src/services/theme/colorThemeService.ts:42


getColorThemeMode

getColorThemeMode(): ColorThemeMode

Get the mode('dark' or 'light') of the current Color Theme

Returns

ColorThemeMode

Defined in

src/services/theme/colorThemeService.ts:54


getThemeById

getThemeById(id): undefined | IColorTheme

Get specific theme via id

Parameters

NameType
idstring

Returns

undefined | IColorTheme

Defined in

src/services/theme/colorThemeService.ts:38


getThemes

getThemes(): IColorTheme[]

Get all themes in colorThemes

Returns

IColorTheme[]

Defined in

src/services/theme/colorThemeService.ts:33


onChange

onChange(callback): void

Listen to the theme changed event

Parameters

NameType
callback(prev: IColorTheme, next: IColorTheme, themeMode: ColorThemeMode) => void

Returns

void

Defined in

src/services/theme/colorThemeService.ts:59


reload

reload(): void

Reload current theme

Returns

void

Defined in

src/services/theme/colorThemeService.ts:46


reset

reset(): void

Reset theme

Returns

void

Defined in

src/services/theme/colorThemeService.ts:50


setTheme

setTheme(id): void

Set the current Color Theme via id, Please ensure the theme could be found in colorThemes

Parameters

NameTypeDescription
idstringThe id is required

Returns

void

Defined in

src/services/theme/colorThemeService.ts:24


updateTheme

updateTheme(theme): void

Update specific theme,

Parameters

NameTypeDescription
themeIColorThemeThe id is required in theme

Returns

void

Defined in

src/services/theme/colorThemeService.ts:29