Skip to content

consolidating rgb & hsl formats#45

Merged
chipcullen merged 4 commits into
mainfrom
consolidating-to-rgb-hsl
Apr 8, 2026
Merged

consolidating rgb & hsl formats#45
chipcullen merged 4 commits into
mainfrom
consolidating-to-rgb-hsl

Conversation

@chipcullen

Copy link
Copy Markdown
Owner

This PR removes the separate rgba & hsla color types - as they are now functionally equivelant to rgb & hsl. In fact, MDN recommends using rgb and hsl only. The input will still accept rgba & hsla, but output will always be the modern syntax.

Copilot AI 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.

Pull request overview

This PR consolidates legacy rgba/hsla handling into the existing rgb/hsl formats, keeping input compatibility while standardizing output on modern CSS syntax.

Changes:

  • Removed rgba and hsla from colorTypes and updated type detection/validation to treat them as aliases of rgb/hsl.
  • Updated translatedColor to emit modern rgb(... / alpha) and hsl(... / alpha) syntax (and updated tests accordingly).
  • Removed rgba/hsla inputs from the UI.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/utils/typeOfColor.ts Stops returning distinct rgba/hsla types; classifies them as rgb/hsl.
src/utils/typeOfColor.test.ts Updates expectations so rgba/hsla map to rgb/hsl.
src/utils/translatedColor.ts Removes rgba/hsla targets and emits modern rgb/hsl alpha syntax.
src/utils/translatedColor.test.ts Reworks translation tests to match consolidated types and modern output.
src/utils/isValidColor.ts Drops isValidRgba/isValidHsla; accepts legacy aliases in isValidRgb/isValidHsl.
src/utils/isValidColor.test.ts Removes rgba/hsla validator tests; adds alias coverage under rgb/hsl validators.
src/utils/colorTypes.ts Removes rgba and hsla enum members.
src/App.tsx Removes dedicated rgba and hsla input fields from the UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/utils/translatedColor.ts
Comment thread src/utils/translatedColor.ts Outdated
Comment thread src/utils/translatedColor.ts Outdated
Comment thread src/utils/translatedColor.ts
Comment thread src/utils/isValidColor.ts
Comment thread src/utils/isValidColor.ts
Comment thread src/utils/translatedColor.test.ts
Comment thread src/utils/isValidColor.test.ts
@chipcullen chipcullen merged commit e615cc4 into main Apr 8, 2026
5 checks passed
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