UNPKG

@thi.ng/color

Version:

Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets

31 lines 1.21 kB
import type { Color, ReadonlyColor } from "./api.js"; /** * Clamps all color channels to `[0,1]` interval and calls `ensureAlpha` to * ensure alpha channel is defined (if missing sets it to `alpha`, default: 1). * * @remarks * If `out` is null, the resulting color will be written back into `src`. * * Note: The result of this function might be different than * {@link TypedColor.clamp}. The latter is taking into account pre-configured * channel value ranges (per color mode). See {@link ChannelSpec.range} for * details. * * @param out - result * @param src - source color * @param alpha - alpha value */ export declare const clamp: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec<number>; /** * Similar to {@link clamp}, but calls `ensureHue` to fold (instead of clamping) * the hue into the `[0,1]` interval. * * @remarks * If `out` is null, the resulting color will be written back into `src`. * * @param out - result * @param src - source color * @param alpha - alpha value */ export declare const clampH: (out: Color | null, src: ReadonlyColor, alpha?: number) => import("@thi.ng/vectors").Vec<number>; //# sourceMappingURL=clamp.d.ts.map