Registry Mirror
Skip to content

Conversation

@joshuaallgaier2-cmd

@joshuaallgaier2-cmd joshuaallgaier2-cmd commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The color converter now accepts hex values without # and the 148 CSS named colors, case-insensitively, plus transparent. currentcolor remains an error because it depends on the surrounding text color. The placeholder, error message, and FAQ describe the accepted formats.

The review revision also rejects inherited object properties such as constructor and __proto__. Previously, the named-color lookup incorrectly returned opaque black for both. An own-property check limits it to the color table's entries.

Closes #496

How I tested this

OpenAI Codex ran these checks on Windows for the latest revision:

  • Added two regression cases before changing the parser: both failed, confirming the inherited-property bug.
  • After the one-line fix, the complete color-utils file passes all 78 tests.
  • npm test: 2,661 passed; two untouched tests timed out at the default five seconds (csv-utils' TypeScript compiler test and RegexTesterClient's 1,000-match navigation test).
  • Focused rerun of color-utils, csv-utils, and RegexTesterClient with two workers and a 30-second timeout: all 233 tests passed across three files.
  • npm run lint: passed with 11 existing warnings in untouched code.
  • npm run build: passed.

To check manually, run npm run dev and open /color-converter. Valid examples include F26DF0, rebeccapurple, RED, and transparent; constructor and __proto__ should show an error. This manual browser check was not performed during this revision.

AI assistance

The original implementation was written with Claude in the DeepSeek Harness. OpenAI Codex reviewed the open PR, reproduced and fixed the inherited-property bug, added regression cases, reviewed the revision diff, and ran the checks reported above. Joshua is not claimed to have personally run or reviewed this revision.

Type of change

  • Bug fix
  • New tool or feature (additional accepted color formats)
  • Tests
  • Refactor or cleanup
  • Docs

Checklist

  • I was assigned the linked issue
  • npm run lint && npm run test && npm run build passes locally (two full-suite timeouts; focused reruns passed as described above)
  • Logic changes live in lib/ and have a test in lib/__tests__/
  • For a bug fix: the new test fails without my change
  • No analytics, trackers, or calls that send user data off-device
  • Works in both light and dark themes (if UI changed)
  • Inputs have labels and it works with the keyboard alone (if UI changed)
  • New tool: registry entry, page.tsx, client component, opengraph-image.tsx, and the bug report dropdown are all done (not applicable: existing tool)

Notes for reviewers

The named-color table is alphabetically ordered and stores 0xRRGGBB values. Transparent is handled separately for its alpha value. The existing claim remains pending: the maintainer said assignment and review will follow once codercops/chatcops#617 merges. No assignment or CI policy was changed.

parseColor() now parses 3, 4, 6, and 8 digit hex values that arrive without the # prefix (as Figma's picker shows them) and the 148 CSS Color Module Level 4 named colors, including transparent. currentcolor stays an error because it can only be resolved from the surrounding text color. The input placeholder, the error message, and the color-converter FAQ mention the new formats.

@anurag629 anurag629 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @joshuaallgaier2-cmd, this does what #496 asks. Lint (develop's 11 warnings), all 2663 tests and the build pass on top of develop, and 5 of the new tests fail on develop's color-utils.ts. All 148 names match the values in the color-name package, and constructor, toString and __proto__ are rejected. On a built copy F26DF0 and RebeccaPurple convert in the main input, white on 663399 gives 8.40:1 in the contrast checker, and currentcolor shows its own message, at 375px and in both themes.

@anurag629
anurag629 merged commit 3561166 into codercops:develop Nov 19, 2026
@anurag629

Copy link
Copy Markdown
Member

Merged, thanks @joshuaallgaier2-cmd! If you haven't yet, come join our Discord (https://discord.gg/mpGdJyjaRQ) and run /link there to connect your GitHub, so you get the Contributor role and your merges show up with your name in the shoutouts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codercops-accepted Merged PR that counts on the monthly leaderboard (oss.codercops.com)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Color converter: accept hex without # and CSS color names like rebeccapurple

2 participants