@dvcol/common-utils
Version:
Typescript library for common utility functions and constants
20 lines (18 loc) • 440 B
text/typescript
type RGBColor = {
r: number;
g: number;
b: number;
};
/**
* Convert an RGB color to a hex color
* @param r The red color component
* @param g The green color component
* @param b The blue color component
*/
declare function rgbToHex({ r, g, b }: RGBColor): string;
/**
* Convert a hex color to an RGB color
* @param hex
*/
declare function hexToRgb(hex: string): RGBColor;
export { type RGBColor, hexToRgb, rgbToHex };