MCPcopy Create free account
hub / github.com/anomalyco/opencode / clamp

Function clamp

packages/ui/src/theme/color.ts:3–5  ·  view source on GitHub ↗
(v: number, min: number, max: number)

Source from the content-addressed store, hash-verified

1import type { HexColor, OklchColor } from "./types"
2
3function clamp(v: number, min: number, max: number) {
4 return Math.max(min, Math.min(max, v))
5}
6
7function hue(v: number) {
8 return ((v % 360) + 360) % 360

Callers 6

toHexFunction · 0.70
fitOklchFunction · 0.70
generateScaleFunction · 0.70
generateNeutralScaleFunction · 0.70
lightenFunction · 0.70
darkenFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected