MCPcopy Create free account
hub / github.com/ChartGPU/ChartGPU / clampInt

Function clampInt

src/renderers/createScatterRenderer.ts:39–39  ·  view source on GitHub ↗
(v: number, lo: number, hi: number)

Source from the content-addressed store, hash-verified

37
38const clamp01 = (v: number): number => Math.min(1, Math.max(0, v));
39const clampInt = (v: number, lo: number, hi: number): number => Math.min(hi, Math.max(lo, v | 0));
40
41const parseSeriesColorToRgba01 = (color: string): Rgba =>
42 parseCssColorToRgba01(color) ?? ([0, 0, 0, 1] as const);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected