@diffusionstudio/core-v4
Version:
2D motion graphics and video rendering engine
43 lines (42 loc) • 1.3 kB
TypeScript
import { hex, Easing, HSL, RGB } from '../types';
/**
* Converts a hex color string to an RGB object
* @param hex - The hex color string to convert
* @returns An object with the red, green, and blue values
*/
export declare function hexToRgb(hex: string): RGB;
/**
* Converts an RGB object to a hex color string
* @param r - The red value
* @param g - The green value
* @param b - The blue value
* @returns The hex color string
*/
export declare function rgbToHex(r: number, g: number, b: number): hex;
/**
* Helper function for easing
* @param t - The time value
* @param easing - The easing function to use
* @returns The eased time value
*/
export declare function ease(t: number, easing?: Easing): number;
/**
* Linear interpolation between two values
* @param start - The start value
* @param end - The end value
* @param t - The time value
* @returns The interpolated value
*/
export declare function lerp(start: number, end: number, t: number): number;
/**
* Converts hex to HSL color space
*/
export declare function hexToHsl(hex: string): HSL;
/**
* Converts RGB to HSL color space
*/
export declare function rgbToHsl(r: number, g: number, b: number): HSL;
/**
* Converts HSL to hex color
*/
export declare function hslToHex(h: number, s: number, l: number): hex;