import { fract } from "@thi.ng/math/prec" ; import type { Hue } from "./api.js" ; /**
 * Returns the  Hue constant of the closest of 12 defined hues.
 *
 *  param h export const closestHue = ( h ) : Hue => Math . round ( fract ( h ) * 12 ) % 12 ; /**
 * Returns the  Hue constant of the closest primary or secondary hue.
 *
 *  param h export const closestPrimaryHue = ( h ) : Hue => closestHue ( h ) & 0xe ;