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

Function scale

src/utils/math.ts:19–21  ·  view source on GitHub ↗
(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number)

Source from the content-addressed store, hash-verified

17export type Matrix = Matrix5x5 | Matrix5x1;
18
19export function scale(x: number, inLow: number, inHigh: number, outLow: number, outHigh: number): number {
20 return (x - inLow) * (outHigh - outLow) / (inHigh - inLow) + outLow;
21}
22
23export function clamp(x: number, min: number, max: number): number {
24 return Math.min(max, Math.max(min, x));

Callers 11

modifyLightModeHSLFunction · 0.90
modifyBgHSLFunction · 0.90
modifyBlueFgHueFunction · 0.90
modifyFgHSLFunction · 0.90
modifyBorderHSLFunction · 0.90
getEventValueFunction · 0.90
SliderFunction · 0.90
scaleWheelDeltaFunction · 0.90
renderHueFunction · 0.90
renderSBFunction · 0.90
math.tests.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected