UNPKG

allc

Version:

A small typescript package for color conversion.

12 lines (11 loc) 293 B
/** * Clamps the given number between 0 and 1. * * @param x The number to clamp. * * @returns The clamped number. */ export const clamp01 = (x: number) => Math.max(0, Math.min(1, x)); export const D_65_XN = 95.0489; export const D_65_YN = 100; export const D_65_ZN = 108.884;