MCPcopy
hub / github.com/darkreader/darkreader / modifyForegroundColor

Function modifyForegroundColor

src/inject/dynamic-theme/modify-colors.ts:269–274  ·  view source on GitHub ↗
(rgb: RGBA, theme: Theme, shouldRegisterColorVariable = true)

Source from the content-addressed store, hash-verified

267}
268
269export function modifyForegroundColor(rgb: RGBA, theme: Theme, shouldRegisterColorVariable = true): string {
270 if (!shouldRegisterColorVariable) {
271 return _modifyForegroundColor(rgb, theme);
272 }
273 return modifyAndRegisterColor('text', rgb, theme, _modifyForegroundColor);
274}
275
276function modifyBorderHSL({h, s, l, a}: HSLA, poleFg: HSLA, poleBg: HSLA): HSLA {
277 const isDark = l < 0.5;

Callers 8

getSelectionColorFunction · 0.90
defaultFallbackFactoryFunction · 0.90
getColorModifierFunction · 0.90
replaceCSSTemplatesFunction · 0.90

Calls 2

_modifyForegroundColorFunction · 0.85
modifyAndRegisterColorFunction · 0.85

Tested by

no test coverage detected