forked from akai/readest
This commit is contained in:
@@ -38,3 +38,7 @@ export function hexToOklch(hexColor: string): string {
|
||||
export const getContrastOklch = (hexColor: string): string => {
|
||||
return tinycolor(hexColor).isDark() ? '100% 0 0' : '0% 0 0';
|
||||
};
|
||||
|
||||
export const getContrastHex = (hex: string): string => {
|
||||
return tinycolor(hex).isDark() ? '#FFFFFF' : '#000000';
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { AppService } from '@/types/system';
|
||||
|
||||
export const parseWebViewVersion = (appService: AppService | null): string => {
|
||||
export const parseWebViewInfo = (appService: AppService | null): string => {
|
||||
const ua = navigator.userAgent;
|
||||
|
||||
if (appService?.isAndroidApp) {
|
||||
@@ -63,3 +63,9 @@ export const parseWebViewVersion = (appService: AppService | null): string => {
|
||||
return 'Unknown';
|
||||
}
|
||||
};
|
||||
|
||||
export const parseWebViewVersion = (appService: AppService | null): number => {
|
||||
const webViewInfo = parseWebViewInfo(appService);
|
||||
const versionMatch = webViewInfo.match(/([0-9]+)\./);
|
||||
return versionMatch ? parseFloat(versionMatch[1]!) : 0;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user