Skip to content

Commit

Permalink
Fix incorrect VG colors parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
daniluk4000 committed Jan 11, 2025
1 parent dd6f55a commit 9668458
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/composables/colors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function hexToRgb(hex: string): string {
if (!hex.startsWith('#')) return hex;

// Remove the hash at the start if it's there
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(shortHexToLong(hex.slice(0, 6)));
const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(shortHexToLong(hex.slice(0, 7)));
if (!result) throw new Error(`Failed to convert color ${ hex } from hex to rgb`);

// Return the RGB color
Expand Down

0 comments on commit 9668458

Please sign in to comment.