@devlander/colors
Version:
Color utility package used between packages
10 lines (9 loc) • 518 B
TypeScript
/**
* Darkens a given color (HEX or RGB) by reducing its brightness.
*
* @param color - The input color in HEX format (e.g., "#ffcc00") or RGB format (e.g., "rgb(255, 204, 0)").
* @param amount - The amount to darken the color by. Must be a positive number.
* @returns The darkened color in RGBA format (e.g., "rgba(205, 152, 0, 1)").
* @throws If the color format is invalid or if amount is not a valid number or negative.
*/
export declare const darkenColorByShade: (color: string, amount: number) => string;