Add support for short hex color codes (like #CCC) #3714

Closed
opened 2026-01-30 23:28:14 +00:00 by claunia · 4 comments
Owner

Originally created by @mikemaccana on GitHub (Sep 2, 2019).

Originally assigned to: @kojoru on GitHub.

Windows 10.0.18908.0. Terminal Preview 0.4.2382.0

Using #CCC instead of #CCCCCC results in an unparsable settings file. Not a big deal but since most other places (eg browser devtools)) that take hex also take short codes, worth fixing.

Not sure re: HSLA etc but that's a separate issue.

Originally created by @mikemaccana on GitHub (Sep 2, 2019). Originally assigned to: @kojoru on GitHub. Windows 10.0.18908.0. Terminal Preview 0.4.2382.0 Using `#CCC` instead of `#CCCCCC` results in an unparsable settings file. Not a big deal but since most other places (eg browser devtools)) that take hex also take short codes, worth fixing. Not sure re: HSLA etc but that's a separate issue.
Author
Owner

@DHowett-MSFT commented on GitHub (Sep 3, 2019):

Yeah, we should probably support this. The first thing, not the HSLA thing.

@DHowett-MSFT commented on GitHub (Sep 3, 2019): Yeah, we should probably support this. The first thing, not the HSLA thing.
Author
Owner

@kojoru commented on GitHub (Sep 3, 2019):

Should be a few lines' worth of change around here, right?
c97cccb55c/src/types/utils.cpp (L92-L105)

Can I try and take a stab at it?

@kojoru commented on GitHub (Sep 3, 2019): Should be a few lines' worth of change around here, right? https://github.com/microsoft/terminal/blob/c97cccb55c393856f92b714970fd3f53224afa19/src/types/utils.cpp#L92-L105 Can I try and take a stab at it?
Author
Owner

@zadjii-msft commented on GitHub (Sep 3, 2019):

@kojoru go right ahead!

Bonus points if you add a test in here :)

@zadjii-msft commented on GitHub (Sep 3, 2019): @kojoru go right ahead! Bonus points if you add a test [in here](https://github.com/microsoft/terminal/blob/master/src/types/ut_types/UtilsTests.cpp) :)
Author
Owner

@ghost commented on GitHub (Sep 24, 2019):

:tada:This issue was addressed in #2658, which has now been successfully released as Windows Terminal Preview v0.5.2661.0.🎉

Handy links:

@ghost commented on GitHub (Sep 24, 2019): :tada:This issue was addressed in #2658, which has now been successfully released as `Windows Terminal Preview v0.5.2661.0`.:tada: Handy links: * [Release Notes](https://github.com/microsoft/terminal/releases/tag/v0.5.2661.0) * [Store Download](https://www.microsoft.com/store/apps/9n0dx20hk701?cid=storebadge&ocid=badge)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#3714