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

Function clamp

src/utils/math.ts:23–25  ·  view source on GitHub ↗
(x: number, min: number, max: number)

Source from the content-addressed store, hash-verified

21}
22
23export function clamp(x: number, min: number, max: number): number {
24 return Math.min(max, Math.max(min, x));
25}
26
27// Note: the caller is responsible for ensuring that matrix dimensions make sense
28export function multiplyMatrices<M extends Matrix>(m1: Matrix5x5, m2: Matrix5x5 | Matrix5x1): M {

Callers 8

darkenFunction · 0.90
getBgImageValueFunction · 0.90
setInversionStyleValueFunction · 0.90
applyColorMatrixFunction · 0.90
getEventValueFunction · 0.90
onWheelFunction · 0.90
HSBPickerFunction · 0.90
math.tests.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…