MCPcopy Index your code
hub / github.com/darkreader/darkreader / _modifyForegroundColor

Function _modifyForegroundColor

src/inject/dynamic-theme/modify-colors.ts:253–267  ·  view source on GitHub ↗
(rgb: RGBA, theme: Theme)

Source from the content-addressed store, hash-verified

251}
252
253function _modifyForegroundColor(rgb: RGBA, theme: Theme) {
254 if (theme.mode === 0) {
255 if (__PLUS__) {
256 const poles = getTextPoles(theme);
257 return modifyColorWithCache(rgb, theme, modifyLightSchemeColorExtended, poles[0], poles[1]);
258 }
259 return modifyLightSchemeColor(rgb, theme);
260 }
261 if (__PLUS__) {
262 const poles = getTextPoles(theme);
263 return modifyColorWithCache(rgb, theme, modifyFgColorExtended, poles[0], poles[1]);
264 }
265 const pole = getFgPole(theme);
266 return modifyColorWithCache(rgb, theme, modifyFgHSL, pole);
267}
268
269export function modifyForegroundColor(rgb: RGBA, theme: Theme, shouldRegisterColorVariable = true): string {
270 if (!shouldRegisterColorVariable) {

Callers 1

modifyForegroundColorFunction · 0.85

Calls 4

getTextPolesFunction · 0.90
modifyColorWithCacheFunction · 0.85
modifyLightSchemeColorFunction · 0.85
getFgPoleFunction · 0.85

Tested by

no test coverage detected