import { Color, Position } from "./types"; export declare const lerp: (x: number, y: number, a: number) => number; export declare const clamp: (a: number, min?: number, max?: number) => number; export declare const invlerp: (x: number, y: number, a: number) => number; export declare const range: (x1: number, y1: number, x2: number, y2: number, a: number) => number; /** * Get random number between range [min, max]. * @param min * @param max * @returns */ export declare const randomInRange: (min: number, max: number) => number; /** * Collection of utilities for `{ x: number, y: number }` data structures. */ export declare const vec2: { /** * Subtract two vectors. * @param a Vector * @param b Position * @return `{ x: a.x - b.x, y: a.y - b.x }` */ subtract: (a: Position, b: Position) => Position; /** * Multiply vector with a number. * @param a Vector * @param b Number * @return `{ x: a.x * b, y: a.y * b }` */ multiply: (a: Position, b: number) => Position; /** * Get length of vector. * @param v Vector * @return Length of vector */ length: (v: Position) => number; /** * Get normalized vector. * @param v Vector * @returns Normalized vector (same direction but length = 1). */ normalize: (v: Position) => Position; }; /** * Interpolate between two colors. * * The color interpolation is done linearly in LAB color space. * * @param a Color 1. * @param b Color 2. * @param factor Ratio between colors 1 and 2 that will be used for the returned color. * @returns Interpolated Color. */ export declare const lerpColor: (a: Color, b: Color, factor: number) => Color;