/** * COLOR FUNCTIONS ============================================================= * ============================================================================= */ /** * Turn Gradient Color Scale into Divided Groups of Gradients with more Distinct Hues Between Adjacent Colors * @example: * colorScaleDistinct(chroma.scale([GOLD_INVERSE, TEAL_INVERSE, VIOLET_INVERSE]).colors(keys.length), 3) * * @param {Array} colors - list of gradient color values to make distinct * @param {Number} hues - count of distinct colors used in the given gradient * @return {Array} colors - grouped in distinct gradients */ export function colorScaleDistinct(colors: any[], hues: number): any[]; /** * Convert given value to a standardized RGB(A) Color Array * * @param {Array|String} value - to check * @return {Array|Boolean} color - if it's a valid color value, else `false` */ export function toRgbaColor(value: any[] | string): any[] | boolean; /** * Check if given value is a valid Array of RGB(A) color numbers/strings * * @param {Array} color - to check * @returns {Boolean} true - if it's valid */ export function isRgba(color: any[]): boolean; /** * Convert an RGB Color to Scaled Color3 Array * @note: in certain frameworks, like Babylon.js, Color3 is an array of RGB numbers ranging from 0 to 1. * * @param {Array} color - with RGB values ranging from 0 to 255 * @param {Number} [precision] - decimal places to keep * @returns {Array} Color3 - with RGB values ranging from 0 to 1 */ export function rgbToColor3(color: Array, precision?: number | undefined): Array; /** * Convert a Scaled Color3 Array to an RGB Color * @note: in certain frameworks, like Babylon.js, Color3 is an array of RGB numbers ranging from 0 to 1. * * @param {Array} color3 - with RGB values ranging from 0 to 1 * @returns {Array} color - with RGB values ranging from 0 to 255 */ export function rgbFromColor3(color3: Array): Array; /** * Convert an RGB Color array to Hex String * @param {[r: number, g: number, b: number]} array - of [r, g, b] numbers * @return {String} hex color */ export function rgbToHex([r, g, b]: [r: number, g: number, b: number]): string; /** * Convert a Hex String to RGB Color if valid * @param {String} hex - string with or without `#` at the beginning * @return {Array|Null} RGB color array - if given valid hex string, else null */ export function rgbFromHex(hex: string): Array | null;