Skip to content

Commit 64cb068

Browse files
committed
type(Convert): add HexColor type.
1 parent 632d4e9 commit 64cb068

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/color-convert/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export const rgbaToHexa = ({ r, g, b, a }: RgbaColor): string => {
187187
const alpha = typeof a === 'number' && ((a * 255) | (1 << 8)).toString(16).slice(1);
188188
return `${rgbaToHex({ r, g, b, a })}${alpha ? alpha : ''}`;
189189
};
190-
190+
export type HexColor = `#${string}`;
191191
export const hexToHsva = (hex: string): HsvaColor => rgbaToHsva(hexToRgba(hex));
192192
export const hexToRgba = (hex: string): RgbaColor => {
193193
const htemp = hex.replace('#', '');

0 commit comments

Comments
 (0)