Skip to content

PR_26177_004-shared-color-foundation#212

Merged
ToolboxAid merged 1 commit into
mainfrom
PR_26177_004-shared-color-foundation
Jun 26, 2026
Merged

PR_26177_004-shared-color-foundation#212
ToolboxAid merged 1 commit into
mainfrom
PR_26177_004-shared-color-foundation

Conversation

@ToolboxAid

Copy link
Copy Markdown
Owner

PR_26177_004-shared-color-foundation

Date: 2026-06-26
Scope: Shared color foundation
Status: PASS

Summary

  • Added src/shared/color/color.js.
  • Added hex/rgb/hsl conversion, clamp, lerp/blend, luminance, and contrast helpers.
  • Added targeted tests in tests/shared/ColorFoundation.test.mjs.
  • No page styling, runtime UI, API, database, or unrelated cleanup changes were made.

Validation

  • PASS: node ./scripts/run-node-test-files.mjs tests/shared/ColorFoundation.test.mjs.
  • PASS: node --check src/shared/color/color.js.
  • PASS: node --check tests/shared/ColorFoundation.test.mjs.
  • PASS: git diff --check.

Artifact

  • tmp/PR_26177_004-shared-color-foundation_delta.zip

@ToolboxAid ToolboxAid changed the base branch from PR_26177_003-shared-geometry-foundation to main June 26, 2026 13:51
@ToolboxAid ToolboxAid marked this pull request as ready for review June 26, 2026 13:51
@ToolboxAid ToolboxAid merged commit c4d0885 into main Jun 26, 2026
1 check passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

return clamp01(number > 1 ? number / 100 : number);

P2 Badge Keep HSL values on one percentage scale

When hslToRgb is fed the output of rgbToHsl, any saturation or lightness between 0 and 1 percent is reinterpreted here as a 0..1 unit fraction instead of a percent. For example, rgbToHsl({ r: 128, g: 127, b: 127 }) returns s: 0.392157, but this helper converts that to ~39% saturation, so the round trip becomes a saturated red ({ r: 178, g: 77, b: 77 }) instead of the original near-gray. Dark colors with l < 1 have the same problem, so the RGB/HSL conversion is not reliable for low-saturation or very dark inputs.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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