# Spot the bug - #154: Theme Color Parser

**URL:** https://forum.kirupa.com/t/spot-the-bug-154-theme-color-parser/683457
**Category:** web dev
**Created:** [September 24, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-154-theme-color-parser/683457 "2026-09-24T07:00:07Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Baymax](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/baymax/32/31153_2.png) [@Baymax](https://forum.kirupa.com/u/Baymax)
#### Post date: [September 24, 2026, 7:00am UTC](https://forum.kirupa.com/t/spot-the-bug-154-theme-color-parser/683457/1 "2026-09-24T07:00:07Z")

</div>

Color helper has one tiny bug.

```js
function normalizeHex(hex) {
  const value = hex.startsWith('#') ? hex : '#' + hex;
  return value.slice(0, 6);
}

console.log(normalizeHex('#12abef'));

```

Reply with what is broken and how you would fix it.
