You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-11-29 22:48:10 +02:00
Plugins: Add support for joplin.shouldUseDarkColors API
This commit is contained in:
@@ -14,6 +14,9 @@ import JoplinClipboard from './JoplinClipboard';
|
||||
import JoplinWindow from './JoplinWindow';
|
||||
import BasePlatformImplementation from '../BasePlatformImplementation';
|
||||
import JoplinImaging from './JoplinImaging';
|
||||
import { themeStyle } from '../../../theme';
|
||||
import Setting from '../../../models/Setting';
|
||||
import { ThemeAppearance } from '../../../themes/type';
|
||||
|
||||
/**
|
||||
* This is the main entry point to the Joplin API. You can access various services using the provided accessors.
|
||||
@@ -137,4 +140,12 @@ export default class Joplin {
|
||||
return this.implementation_.versionInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells whether the current theme is a dark one or not.
|
||||
*/
|
||||
public async shouldUseDarkColors() {
|
||||
const theme = themeStyle(Setting.value('theme'));
|
||||
return theme.appearance === ThemeAppearance.Dark;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user