forked from akai/readest
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import { HIGHLIGHT_COLOR_HEX } from '@/services/constants';
|
||||
import { HighlightColor } from '@/types/book';
|
||||
import { SystemSettings } from '@/types/settings';
|
||||
|
||||
export const getHighlightColorHex = (settings: SystemSettings, color?: HighlightColor) => {
|
||||
if (!color) return color;
|
||||
|
||||
const customColors = settings.globalReadSettings.customHighlightColors;
|
||||
return customColors?.[color] ?? HIGHLIGHT_COLOR_HEX[color];
|
||||
};
|
||||
Reference in New Issue
Block a user