swaywm / swaybg

Wallpaper tool for Wayland compositors
MIT License
490 stars 31 forks source link

Allow 3-digit hex colors #66

Open milkey-mouse opened 5 months ago

milkey-mouse commented 5 months ago

These are common enough (especially on the web) that a new user might try to use a 3-digit hex color such as #f00. We might as well make this work and save a few seconds of confusion/RTFM.

See also https://github.com/swaywm/swaylock/pull/352.

mstoeckl commented 5 months ago

I (only part of swaybg, not swaylock or the other repositories) am ambivalent. I do think that color formats should be consistent between swaynag, swaylock, swaybar, swaybg, and sway itself, which does raise the bar for this PR since the benefit of this change should be worth making and maintaining edits to code and documentation in all of these projects.

Notes:

We might as well make this work and save a few seconds of confusion/RTFM.

I opened https://github.com/swaywm/swaybg/pull/67, which should document the color requirement a bit better.

milkey-mouse commented 4 months ago

I have changes ready to go for the other sway* projects, as I agree consistency between them would be important. (In fact this change to swaybg isn't too useful until sway itself can parse 3-digit colors for an output's background.) But I see what you mean how across projects it might be better to hold the line at 6 digits.

I don't see many third-party scripts programmatically parsing sway config files, though, so the only case in which this would matter is interactive copy-pasting. I know of a couple other desktop programs that support 3-digit hex colors already such as conky.