[PR #2658] [MERGED] Add support for short hex color codes like #CCC (#2639) #25022

Open
opened 2026-01-31 09:06:46 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/2658
Author: @kojoru
Created: 9/4/2019
Status: Merged
Merged: 9/4/2019
Merged by: @DHowett-MSFT

Base: masterHead: 2639_add_short_hex_color_support


📝 Commits (2)

📊 Changes

2 files changed (+19 additions, -6 deletions)

View changed files

📝 src/cascadia/ut_app/JsonTests.cpp (+1 -1)
📝 src/types/utils.cpp (+18 -5)

📄 Description

Summary of the Pull Request

This adds a few lines to support shorthand color hex codes like #ABC. They are treated as equivalent of #AABBCC

References

N/A

PR Checklist

  • Closes Run As Administrator (#2639)
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Doesn't require documentation to be updated as far as I understand
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #2639

Detailed Description of the Pull Request / Additional comments

The PR is only a few lines of code so should be self-explanatory.

Validation Steps Performed

I've changed src/cascadia/ut_app/JsonTests.cpp thanks to the fact that Cascadia actually has a white color that can be expressed this way. The new test passes on my machine.

I thought that change might be a better idea than adding a new test to https://github.com/microsoft/terminal/blob/master/src/types/ut_types/UtilsTests.cpp as discussed originally, if only for the reason of simplicity. I'll be happy to write an explicit test if that seems like a better idea to maintainers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/2658 **Author:** [@kojoru](https://github.com/kojoru) **Created:** 9/4/2019 **Status:** ✅ Merged **Merged:** 9/4/2019 **Merged by:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Base:** `master` ← **Head:** `2639_add_short_hex_color_support` --- ### 📝 Commits (2) - [`b5c2693`](https://github.com/microsoft/terminal/commit/b5c2693172d22a1171d1c0629a3990632d30d7b6) Add support for short hex color codes like #CCC (#2639) - [`0008288`](https://github.com/microsoft/terminal/commit/000828808a2363b6c4eb21e01e8425108a19ad5f) Formatting fix (#2639) ### 📊 Changes **2 files changed** (+19 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/ut_app/JsonTests.cpp` (+1 -1) 📝 `src/types/utils.cpp` (+18 -5) </details> ### 📄 Description <!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? --> ## Summary of the Pull Request This adds a few lines to support shorthand color hex codes like `#ABC`. They are treated as equivalent of `#AABBCC` <!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> ## References N/A <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist * [x] Closes #2639 * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [x] Tests added/passed * [x] Doesn't require documentation to be updated as far as I understand * [x] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #2639 <!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments The PR is only a few lines of code so should be self-explanatory. <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed I've changed `src/cascadia/ut_app/JsonTests.cpp` thanks to the fact that Cascadia actually has a white color that can be expressed this way. The new test passes on my machine. I thought that change might be a better idea than adding a new test to https://github.com/microsoft/terminal/blob/master/src/types/ut_types/UtilsTests.cpp as discussed originally, if only for the reason of simplicity. I'll be happy to write an explicit test if that seems like a better idea to maintainers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:06:46 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#25022