@tempots/color

clampInt() function

clampInt restricts a value within the specified range and returns an integer.

Signature:

clampInt: (value: number, min: number, max: number) => number

Parameters

Parameter

Type

Description

value

number

The value to clamp.

min

number

The minimum value.

max

number

The maximum value.

Returns: number

The clamped value as an integer.