MCPcopy
hub / github.com/omgovich/colord / clamp

Function clamp

src/helpers.ts:23–25  ·  view source on GitHub ↗
(number: number, min = 0, max = 1)

Source from the content-addressed store, hash-verified

21 * NaN is clamped to the lower bound
22 */
23export const clamp = (number: number, min = 0, max = 1): number => {
24 return number > max ? max : number > min ? number : min;
25};
26
27/**
28 * Processes and clamps a degree (angle) value properly.

Callers 11

clampXyzaFunction · 0.90
clampLchaFunction · 0.90
clampCmykaFunction · 0.90
clampHslaFunction · 0.90
clampHsvaFunction · 0.90
clampHwbaFunction · 0.90
clampRgbaFunction · 0.90
clampLabaFunction · 0.90
labPluginFunction · 0.90
saturateFunction · 0.90
lightenFunction · 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…