Download apps/readest-app/src/app/reader/utils/annotatorUtil.ts from echodict/readest: direct link, hf CLI and curl.
- Browser
- Download file 492 Bytes
-
https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/app/reader/utils/annotatorUtil.ts
- Command line
-
hf download hf://datasets/echodict/readest/apps/readest-app/src/app/reader/utils/annotatorUtil.ts
-
curl -L -o annotatorUtil.ts https://huggingface.co/datasets/echodict/readest/resolve/main/apps/readest-app/src/app/reader/utils/annotatorUtil.ts
492 Bytes
| import { HIGHLIGHT_COLOR_HEX } from '@/services/constants'; | |
| import { HighlightColor } from '@/types/book'; | |
| import { SystemSettings } from '@/types/settings'; | |
| export const getHighlightColorHex = ( | |
| settings: SystemSettings, | |
| color?: HighlightColor, | |
| ): string | undefined => { | |
| if (!color) return undefined; | |
| if (color.startsWith('#')) return color; | |
| const customColors = settings.globalReadSettings.customHighlightColors; | |
| return customColors?.[color] ?? HIGHLIGHT_COLOR_HEX[color]; | |
| }; | |