Skip to content

Commit

Permalink
fix(color-convert): fix rgbaToHexa issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jul 10, 2021
1 parent a8278bf commit 7724b72
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/color-convert/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export const rgbaToHex = ({ r, g, b }: RgbaColor): string => {
};

export const rgbaToHexa = ({ r, g, b, a }: RgbaColor): string => {
const alpha = a && ((a * 255) | (1 << 8)).toString(16).slice(1);
const alpha = typeof a === 'number' && ((a * 255) | (1 << 8)).toString(16).slice(1);
return `${rgbaToHex({ r, g, b, a })}${alpha ? alpha : ''}`;
};

Expand Down

0 comments on commit 7724b72

Please sign in to comment.