UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

14 lines 731 B
/** * Converts a CSS color string (hex, rgb, hsl, etc.) to a decimal color value. * * - If the input is a valid color string, it returns the decimal RGB representation (e.g. 16729344 for `#ff6600`). * - If invalid, returns `0`. * - If the input is already a number and valid, returns it unchanged. * * @param {string|number} color - The color input (e.g. "#ff6600", "rgb(255, 102, 0)", or a decimal number). * @param {function} [errCallback] - Optional callback to handle parsing errors. * @returns {number} The decimal representation of the color, or 0 if invalid. * @deprecated */ export default function decimalColor(color: string | number, errCallback?: Function): number; //# sourceMappingURL=decimalColor.d.mts.map