[PR #5847] [MERGED] Switch the Cascadia projects to til::color where it's easily possible to do so #26498

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

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/5847
Author: @DHowett-MSFT
Created: 5/11/2020
Status: Merged
Merged: 5/15/2020
Merged by: @undefined

Base: masterHead: dev/duhowett/tilcolor-1


📝 Commits (5)

  • 02dbc76 Replace uint32_t/COLORREF in Terminal{App,Control} with til::color
  • 6cb9765 Replace COLORREF in WindowsTerminal (EXE) with til::color
  • a5e352d utils: replace COLORREF with til::color
  • 2c63df9 fode cormat
  • c8c69c8 color: add WithAlpha test, move output helper to to_string

📊 Changes

18 files changed (+143 additions, -102 deletions)

View changed files

📝 src/cascadia/TerminalApp/ColorScheme.cpp (+11 -11)
📝 src/cascadia/TerminalApp/ColorScheme.h (+11 -11)
📝 src/cascadia/TerminalApp/JsonUtils.cpp (+2 -2)
📝 src/cascadia/TerminalApp/JsonUtils.h (+1 -1)
📝 src/cascadia/TerminalApp/Profile.cpp (+3 -3)
📝 src/cascadia/TerminalApp/Profile.h (+7 -7)
📝 src/cascadia/TerminalControl/TermControl.cpp (+10 -18)
📝 src/cascadia/TerminalControl/TermControl.h (+1 -1)
📝 src/cascadia/TerminalCore/Terminal.cpp (+1 -1)
📝 src/cascadia/TerminalCore/Terminal.hpp (+2 -2)
📝 src/cascadia/WinRTUtils/inc/Utils.h (+0 -16)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp (+4 -5)
📝 src/cascadia/WindowsTerminal/NonClientIslandWindow.h (+1 -1)
📝 src/inc/DefaultSettings.h (+0 -2)
📝 src/inc/til/color.h (+61 -0)
📝 src/til/ut_til/ColorTests.cpp (+20 -13)
📝 src/types/inc/utils.hpp (+2 -2)
📝 src/types/utils.cpp (+6 -6)

📄 Description

This pull request moves swaths of Cascadia to use til::color for color
interop. There are still some places where we use COLORREF, such as in
the ABI boundaries between WinRT components.

I've also added two more til::color helpers - with_alpha, which takes
an existing color and sets its alpha component, and a
Windows::UI::Color convertor pair.

Future direction might include a TerminalSettings::Color type at the
idl boundary so we can finally stop using UInt32s (!) for color.

Validation Steps Performed

Tested certain fragile areas:

  • setting the background with OSC 11
  • setting the background when acrylic is in use (which requires
    low-alpha)

🔄 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/5847 **Author:** [@DHowett-MSFT](https://github.com/DHowett-MSFT) **Created:** 5/11/2020 **Status:** ✅ Merged **Merged:** 5/15/2020 **Merged by:** [@undefined](undefined) **Base:** `master` ← **Head:** `dev/duhowett/tilcolor-1` --- ### 📝 Commits (5) - [`02dbc76`](https://github.com/microsoft/terminal/commit/02dbc7618b1b1bf01d224e61eada6992e9740f7e) Replace uint32_t/COLORREF in Terminal{App,Control} with til::color - [`6cb9765`](https://github.com/microsoft/terminal/commit/6cb97653d1173232ae79fac82885d339660d03fd) Replace COLORREF in WindowsTerminal (EXE) with til::color - [`a5e352d`](https://github.com/microsoft/terminal/commit/a5e352d63dbe0bb6fde761c752bfe4976906c649) utils: replace COLORREF with til::color - [`2c63df9`](https://github.com/microsoft/terminal/commit/2c63df9e1f7365f15554d3dc5a2b872046394b86) fode cormat - [`c8c69c8`](https://github.com/microsoft/terminal/commit/c8c69c847f9c832cf15c600beb69dab68db8f4de) color: add WithAlpha test, move output helper to to_string ### 📊 Changes **18 files changed** (+143 additions, -102 deletions) <details> <summary>View changed files</summary> 📝 `src/cascadia/TerminalApp/ColorScheme.cpp` (+11 -11) 📝 `src/cascadia/TerminalApp/ColorScheme.h` (+11 -11) 📝 `src/cascadia/TerminalApp/JsonUtils.cpp` (+2 -2) 📝 `src/cascadia/TerminalApp/JsonUtils.h` (+1 -1) 📝 `src/cascadia/TerminalApp/Profile.cpp` (+3 -3) 📝 `src/cascadia/TerminalApp/Profile.h` (+7 -7) 📝 `src/cascadia/TerminalControl/TermControl.cpp` (+10 -18) 📝 `src/cascadia/TerminalControl/TermControl.h` (+1 -1) 📝 `src/cascadia/TerminalCore/Terminal.cpp` (+1 -1) 📝 `src/cascadia/TerminalCore/Terminal.hpp` (+2 -2) 📝 `src/cascadia/WinRTUtils/inc/Utils.h` (+0 -16) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.cpp` (+4 -5) 📝 `src/cascadia/WindowsTerminal/NonClientIslandWindow.h` (+1 -1) 📝 `src/inc/DefaultSettings.h` (+0 -2) 📝 `src/inc/til/color.h` (+61 -0) 📝 `src/til/ut_til/ColorTests.cpp` (+20 -13) 📝 `src/types/inc/utils.hpp` (+2 -2) 📝 `src/types/utils.cpp` (+6 -6) </details> ### 📄 Description This pull request moves swaths of Cascadia to use `til::color` for color interop. There are still some places where we use `COLORREF`, such as in the ABI boundaries between WinRT components. I've also added two more til::color helpers - `with_alpha`, which takes an existing color and sets its alpha component, and a `Windows::UI::Color` convertor pair. Future direction might include a `TerminalSettings::Color` type at the idl boundary so we can finally stop using UInt32s (!) for color. ## Validation Steps Performed Tested certain fragile areas: * [x] setting the background with OSC 11 * [x] setting the background when acrylic is in use (which requires low-alpha) --- <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:16:26 +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#26498