Skip to content

fix: correctly parse 8-digit #RRGGBBAA hex colors#1005

Merged
DavidHDev merged 7 commits into
DavidHDev:mainfrom
Jw705:feat/fix-hex-colors
Jul 20, 2026
Merged

fix: correctly parse 8-digit #RRGGBBAA hex colors#1005
DavidHDev merged 7 commits into
DavidHDev:mainfrom
Jw705:feat/fix-hex-colors

Conversation

@Jw705

@Jw705 Jw705 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Hex-to-RGB helpers that use parseInt(fullHex, 16) with bit shifts incorrectly parse 8-digit hex colors (#RRGGBBAA).

The alpha channel is treated as part of the RGB value, causing the color to be shifted (e.g. #FF0000FF is parsed as (0, 0, 255) instead of (255, 0, 0)).

This can happen when users paste colors from design tools or color pickers that export colors in the #RRGGBBAA format.

Fix:
Parse only the first 6 digits using .slice(0, 6), following the same approach used in CurvedInput. The alpha channel is ignored, while the RGB values are parsed correctly.

Updated components (all variants):

  • PrismaticBurst
  • FaultyTerminal
  • LaserFlow
  • CursorGrid
  • Particles
  • Folder
  • ElectricBorder

Thanks to @yceffort for spotting this issue during review.

@DavidHDev
DavidHDev merged commit 8d1c5fa into DavidHDev:main Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants