Skip to content

feat: add color-key transparency#479

Open
CyberShadow wants to merge 3 commits intoWillPower3309:masterfrom
CyberShadow:colorkey
Open

feat: add color-key transparency#479
CyberShadow wants to merge 3 commits intoWillPower3309:masterfrom
CyberShadow:colorkey

Conversation

@CyberShadow
Copy link
Copy Markdown

Implemented as more of a color search-and-replace feature.

This allows enabling a transparent background on apps which are not alpha-aware - pick an unlikely color to use as the background, then configure SwayFX to remap it to another color with an alpha value.

Requires wlrfx/scenefx#160.

Implemented as more of a color search-and-replace feature.

This allows enabling a transparent background on apps which are not alpha-aware
- pick an unlikely color to use as the background, then configure SwayFX to
remap it to another color with an alpha value.

Requires wlrfx/scenefx#160.
@the-eater
Copy link
Copy Markdown
Contributor

can you show any examples and how you're using it?

@CyberShadow
Copy link
Copy Markdown
Author

Sure! In my config, I added:

# colorkey patch
for_window [class="Emacs"] colorkey #171925 #000000b3
for_window [app_id="firefox"] colorkey #171925 #000000b3

Then, e.g. in Emacs:

(add-to-list 'default-frame-alist (cons 'background-color "#171925"))

Or in Firefox:

https://color.firefox.com/?theme=XQAAAAIBAQAAAAAAAABBKYhm849SCia2CaaEGccwS-xNKlhQbX3V2ZH_U2Zih7gdL5pcAb7xqXopx6rrNu64FU1kYiXmoT8FOzJEan3_-SPW6mn7A5ST4X8QzZEqJPpPcd7InGuFdbw_BdQwT5EnryLgTc1NGbeQRSuzhfYD_D3Szr5CL2M1MBmKRSRBAI6zJq7esWxDczrC7RON8rcCXGYP___sWlPA

Besides the Sway support, none of this is original - it's the same idea that people have been doing with e.g. picom's --glx-fshader-win / window-shader-fg-rule.

@the-eater
Copy link
Copy Markdown
Contributor

ah sorry, i wasn't being clear, i understand how to use it, i meant if you could include screenshots, I am worried that with subpixel rendering text might look really weird

also could you disclose if you used AI for this PR

@CyberShadow
Copy link
Copy Markdown
Author

ah sorry, i wasn't being clear, i understand how to use it, i meant if you could include screenshots, I am worried that with subpixel rendering text might look really weird

Sure. However, the results are also going to be the same as with existing software implementing this technique (which was the goal).

Here's what my Firefox looks like:

image

(normally websites' backgrounds are opaque, but Kagi coincidentally uses the exact same color)

and Emacs:

image

It's mostly unchanged from my 2017 setup with i3+compton:

https://blog.cy.md/2017/04/24/rice/

also could you disclose if you used AI for this PR

Yes, the patch is drafted by Claude Opus 4.5.

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